mirror of https://github.com/hunshcn/gh-proxy
fix issue #20
parent
23b9fa312e
commit
be400183e7
|
@ -52,7 +52,10 @@ def proxy(u):
|
|||
if i in request.headers:
|
||||
r_headers[i] = request.headers.get(i)
|
||||
try:
|
||||
r = requests.request(method=request.method, url=u + request.url.replace(request.base_url, '', 1), data=request.data, headers=r_headers, stream=True)
|
||||
url = u + request.url.replace(request.base_url, '', 1)
|
||||
if url.startswith('https:/') and not url.startswith('https://'):
|
||||
url = 'https://' + url[7:]
|
||||
r = requests.request(method=request.method, url=url, data=request.data, headers=r_headers, stream=True)
|
||||
for i in ['Content-Type']:
|
||||
if i in r.headers:
|
||||
headers[i] = r.headers.get(i)
|
||||
|
|
Loading…
Reference in New Issue