mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-01-08 22:28:01 -05:00
Use urllib instead of magic replace
This commit is contained in:
parent
fa7255e091
commit
d030863245
@ -15,6 +15,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import urllib.parse
|
||||||
from json import JSONDecodeError
|
from json import JSONDecodeError
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
@ -452,13 +453,9 @@ class ProxyDaemon:
|
|||||||
|
|
||||||
assert session
|
assert session
|
||||||
|
|
||||||
path = request.path
|
path = urllib.parse.quote(request.path) # re-encode path stuff like room aliases
|
||||||
method = request.method
|
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 = CIMultiDict(request.headers)
|
||||||
headers.pop("Host", None)
|
headers.pop("Host", None)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user