fix: Proxy url encoded

pull/121/head
libsgh 2024-02-18 15:15:44 +08:00
parent e1b7639159
commit 9bf5f34e75
1 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,7 @@ from requests.utils import (
stream_decode_response_unicode, iter_slices, CaseInsensitiveDict)
from urllib3.exceptions import (
DecodeError, ReadTimeoutError, ProtocolError)
from urllib.parse import quote
# config
# 分支文件使用jsDelivr镜像的开关0为关闭默认关闭
@ -154,6 +155,7 @@ def handler(u):
if url.startswith('https:/') and not url.startswith('https://'):
url = 'https://' + url[7:]
return redirect(url)
u = quote(u, safe='/:')
return proxy(u)