mirror of https://github.com/hunshcn/gh-proxy
fix: add default encoding
parent
61765b9529
commit
f309780131
|
@ -30,8 +30,6 @@ exp3 = re.compile(r'^(?:https?://)?github\.com/.+?/.+?/(?:info|git-).*$')
|
|||
exp4 = re.compile(r'^(?:https?://)?raw\.githubusercontent\.com/.+?/.+?/.+?/.+$')
|
||||
exp5 = re.compile(r'^(?:https?://)?gist\.(?:githubusercontent|github)\.com/.+?/.+?/.+$')
|
||||
|
||||
requests.models.PreparedRequest.prepare_headers = lambda _, __: None
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
|
@ -110,6 +108,7 @@ def proxy(u):
|
|||
r_headers = dict(request.headers)
|
||||
if 'Host' in r_headers:
|
||||
r_headers.pop('Host')
|
||||
r_headers['Accept-Encoding'] = request.headers.get('Accept-Encoding', 'identity')
|
||||
try:
|
||||
url = u + request.url.replace(request.base_url, '', 1)
|
||||
if url.startswith('https:/') and not url.startswith('https://'):
|
||||
|
|
Loading…
Reference in New Issue