From d030863245d6482b162c51cd56f356b11fd6c926 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 9 Oct 2019 12:41:03 +0100 Subject: [PATCH] Use urllib instead of magic replace --- pantalaimon/daemon.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pantalaimon/daemon.py b/pantalaimon/daemon.py index 6fab5b6..b5b3a1f 100755 --- a/pantalaimon/daemon.py +++ b/pantalaimon/daemon.py @@ -15,6 +15,7 @@ import asyncio import json import os +import urllib.parse from json import JSONDecodeError from typing import Any, Dict @@ -452,13 +453,9 @@ class ProxyDaemon: assert session - path = request.path + path = urllib.parse.quote(request.path) # re-encode path stuff like room aliases method = request.method - # This is very much a dirty hack, but it is fine for now - if "#" in path: - path = path.replace("#", "%23") - headers = CIMultiDict(request.headers) headers.pop("Host", None)