diff options
Diffstat (limited to 'bin/WIP/taler-local')
-rwxr-xr-x | bin/WIP/taler-local | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/bin/WIP/taler-local b/bin/WIP/taler-local index c30fbc4..7fe431a 100755 --- a/bin/WIP/taler-local +++ b/bin/WIP/taler-local @@ -366,7 +366,6 @@ def build(without_repos, only_repos) -> None: if only_repos != "" and without_repos != "": print("Either use --only-repos or --without-repos") exit(1) - repos_names = get_repos_names() if only_repos != "": repos_names = list(filter( @@ -513,7 +512,7 @@ class TalerReverseProxy(Flask): socket_path = f"{self.unix_sockets_dir}/{component}.sock" self.logger.debug("Proxying to: " + socket_path + "/" + path) - uri = f"http+unix://{quote(socket_path, safe='')}/{path}" + uri = f"http+unix://{quote(socket_path, safe='')}/{path.replace('?', '%3F')}" if len(request.args) > 0: uri += f"?{request.query_string.decode()}" resp = method( @@ -539,12 +538,29 @@ class TalerReverseProxy(Flask): # the following header would confuse the client. if k == "Content-Encoding" and (resp.headers[k] in ["deflate", "gzip"]): continue + # 'requests' collapses multiple Set-Cookies response headers + # into one (comma-separated list of cookie definitions). That + # breaks browsers' cookie acceptance, resulting in HTTP sessions + # being lost. A typical example is the blog shop not functioning + # for this reason. + # + # Skipping here, as it appears to _still_ collapse them, even if + # each one is individually set. Trying below via the "final" flask + # Response object. + if k == "Set-Cookie": + continue headers.set(k, resp.headers[k]) - return Response( + + Resp = Response( response=resp.text, status=resp.status_code, headers=headers, ) + if "Set-Cookie" in resp.headers: + cookies = resp.headers["Set-Cookie"].split(",") + for cookie in cookies: + Resp.headers.add("Set-Cookie", cookie.strip()) + return Resp def get_app(self): return self @@ -715,7 +731,6 @@ def prepare(): env = customer_env, capture_stdout=True ).run() - print("MEGA DEBUG " + r) return json.loads(r) def prepare_sandbox_account( |