Merge pull request #121 from libsgh/patch-1

fix: Proxy url encoded
pull/124/head
hunshcn 9 months ago committed by GitHub
commit af06c85c3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

Loading…
Cancel
Save