gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-merchant-demos] 01/02: formatting, urlquote cookie path


From: gnunet
Subject: [taler-taler-merchant-demos] 01/02: formatting, urlquote cookie path
Date: Mon, 07 Sep 2020 14:53:52 +0200

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

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

commit aefea29299e7fcd13f6515f82a8e24173bf96fd0
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Mon Sep 7 18:21:43 2020 +0530

    formatting, urlquote cookie path
---
 talermerchantdemos/blog/blog.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py
index 166b194..f510f71 100644
--- a/talermerchantdemos/blog/blog.py
+++ b/talermerchantdemos/blog/blog.py
@@ -33,12 +33,18 @@ from talermerchantdemos.httpcommon import backend_get, 
backend_post
 
 if not sys.version_info.major == 3 and sys.version_info.minor >= 6:
     print("Python 3.6 or higher is required.")
-    print("You are using Python {}.{}.".format(sys.version_info.major, 
sys.version_info.minor))
+    print(
+        "You are using Python {}.{}.".format(
+            sys.version_info.major, sys.version_info.minor
+        )
+    )
     sys.exit(1)
 
 
 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-app = flask.Flask(__name__, template_folder=BASE_DIR, static_folder=BASE_DIR + 
'/../static/')
+app = flask.Flask(
+    __name__, template_folder=BASE_DIR, static_folder=BASE_DIR + "/../static/"
+)
 app.secret_key = base64.b64encode(os.urandom(64)).decode("utf-8")
 
 LOGGER = logging.getLogger(__name__)
@@ -254,11 +260,15 @@ def article(article_name, data=None):
     au = pay_status.get("already_paid_fulfillment_url")
     if ai is not None and au is not None:
         response = flask.redirect(au)
-        response.set_cookie("order_id", ai, path=f"/essay/{article_name}")
+        response.set_cookie(
+            "order_id", ai, path=urllib.parse.quote(f"/essay/{article_name}")
+        )
         return response
 
     # Redirect the browser to a page where the wallet can
     # run the payment protocol.
     response = flask.redirect(pay_status["order_status_url"])
-    response.set_cookie("order_id", order_id, path=f"/essay/{article_name}")
+    response.set_cookie(
+        "order_id", order_id, path=urllib.parse.quote(f"/essay/{article_name}")
+    )
     return response

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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