[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-merchant-demos] branch master updated: fix cookie path for
From: |
gnunet |
Subject: |
[taler-taler-merchant-demos] branch master updated: fix cookie path for a proxied blog |
Date: |
Thu, 25 Nov 2021 21:49:38 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository taler-merchant-demos.
The following commit(s) were added to refs/heads/master by this push:
new fe8061f fix cookie path for a proxied blog
fe8061f is described below
commit fe8061f4494decabef75eb4076c362dc2c93ed73
Author: ms <ms@taler.net>
AuthorDate: Thu Nov 25 21:42:27 2021 +0100
fix cookie path for a proxied blog
---
talermerchantdemos/blog/blog.py | 28 ++++++++++++++++++++++++----
talermerchantdemos/blog/content.py | 3 ++-
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py
index 5fce6c8..d8bf6d6 100644
--- a/talermerchantdemos/blog/blog.py
+++ b/talermerchantdemos/blog/blog.py
@@ -392,18 +392,38 @@ def article(article_name, lang=None, data=None):
if ai is not None and au is not None:
response = flask.redirect(au)
response.set_cookie(
- "order_id", ai, path=urllib.parse.quote(f"/essay/{article_name}")
+ "order_id",
+ ai,
+ path=urllib.parse.quote(
+ flask.request.environ["SCRIPT_NAME"] + f"/essay/{article_name}"
+ )
)
response.set_cookie(
- "order_id", ai,
path=urllib.parse.quote(f"/{lang}/essay/{article_name}")
+ "order_id",
+ ai,
+ path=urllib.parse.quote(
+ flask.request.environ["SCRIPT_NAME"] +
f"/{lang}/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=f"/{lang}/essay/{article_name}")
+ response.set_cookie(
+ "order_id",
+ order_id,
+ path=urllib.parse.quote(
+ flask.request.environ["SCRIPT_NAME"] + f"/essay/{article_name}"
+ )
+ )
+ response.set_cookie(
+ "order_id",
+ order_id,
+ path=urllib.parse.quote(
+ flask.request.environ["SCRIPT_NAME"] +
f"/{lang}/essay/{article_name}"
+ )
+ )
return response
diff --git a/talermerchantdemos/blog/content.py
b/talermerchantdemos/blog/content.py
index d049718..658f017 100644
--- a/talermerchantdemos/blog/content.py
+++ b/talermerchantdemos/blog/content.py
@@ -99,7 +99,8 @@ def add_from_html(resource_name, lang):
title = resource_name
else:
title = title_el.get_text().strip()
- slug = quote(title.replace(" ", "_"), safe="")
+ slug = title.replace(" ", "_")
+ # slug = quote(title.replace(" ", "_"), safe="")
teaser = soup.find("p", attrs={"id": ["teaser"]})
if teaser is None:
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-taler-merchant-demos] branch master updated: fix cookie path for a proxied blog,
gnunet <=