gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant-frontends] branch master updated: fix url j


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant-frontends] branch master updated: fix url joining to be always relative to app root
Date: Thu, 12 Jan 2017 13:50:04 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository merchant-frontends.

The following commit(s) were added to refs/heads/master by this push:
     new 2170eba  fix url joining to be always relative to app root
2170eba is described below

commit 2170eba062620f4b558b8d00b9ad51a8e54fd4ec
Author: Florian Dold <address@hidden>
AuthorDate: Thu Jan 12 13:48:27 2017 +0100

    fix url joining to be always relative to app root
---
 talerfrontends/helpers.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/talerfrontends/helpers.py b/talerfrontends/helpers.py
index 567be42..ab61754 100644
--- a/talerfrontends/helpers.py
+++ b/talerfrontends/helpers.py
@@ -101,8 +101,16 @@ def amount_get_zero():
     return {"value": 0, "fraction": 0, "currency": CURRENCY}
 
 def make_url(page, *query_params):
-    root = request.base_url
+    """
+    Return a URL to a page in the current Flask application with the given
+    query parameters (sequence of key/value pairs).
+    """
     query = urlencode(query_params)
+    if page.startswith("/"):
+        root = request.url_root
+        page = page.lstrip("/")
+    else:
+        root = request.base_url
     url = urljoin(root, "%s?%s" % (page, query))
     # urlencode is overly eager with quoting, the wallet right now
     # needs some characters unquoted.

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]