From 054a3bcb0b39a33553a9898153443056dc1832fd Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Thu, 26 Aug 2021 20:29:53 +0200 Subject: [PATCH] pantalaimon: Forward raw path instead of quoting the decoded path If the original path had quoted slash characters (`%2F`), the code decoded them and then left them unquoted, causing the forwarded request to fail. An example is trying to ban a user with a slash in their name using Mjolnir, which PUTs a state event with `rule:` in the URL. Use the undecoded path to avoid this. --- pantalaimon/daemon.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pantalaimon/daemon.py b/pantalaimon/daemon.py index bbec91a..ffe0f57 100755 --- a/pantalaimon/daemon.py +++ b/pantalaimon/daemon.py @@ -482,9 +482,7 @@ class ProxyDaemon: assert session - path = urllib.parse.quote( - request.path - ) # re-encode path stuff like room aliases + path = request.raw_path method = request.method headers = CIMultiDict(request.headers)