[Patchew-devel] [PATCH 1/5] git: include absolute link to log in REST result

Paolo Bonzini pbonzini at redhat.com
Sat Mar 17 14:47:10 UTC 2018


Links in the REST API should be absolute.  The next patch will
centralize this in the Result object, in the meanwhile fix the
git plugin.

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 mods/git.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mods/git.py b/mods/git.py
index 4fd7dbe..69b5da8 100644
--- a/mods/git.py
+++ b/mods/git.py
@@ -123,8 +123,8 @@ class GitModule(PatchewModule):
                 git_tag = message.get_property("git.tag")
                 data = {'repo': git_repo, 'tag': 'refs/tags/' + git_tag}
                 result = {'status': 'success', 'data': data}
-            result['log_url'] = reverse("git-log",
-                                        kwargs={'series': message.message_id})
+            log_url = reverse("git-log", kwargs={'series': message.message_id})
+            result['log_url'] = request.build_absolute_uri(log_url)
         else:
             result = {'status': 'pending'}
         results['git'] = result
-- 
2.16.2





More information about the Patchew-devel mailing list