Use urllib instead of magic replace

This commit is contained in:
Travis Ralston 2019-10-09 12:41:03 +01:00
parent fa7255e091
commit d030863245

View File

@ -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)