check for none
This commit is contained in:
parent
832cb49357
commit
d080d51287
@ -87,7 +87,10 @@ def get_proxy_url(proxy, current, path):
|
||||
return presp.text
|
||||
|
||||
def upstream_type(current, proxy):
|
||||
resp = requests.head(current, proxies=proxy.req)
|
||||
if proxy is None:
|
||||
resp = requests.head(current)
|
||||
else:
|
||||
resp = requests.head(current, proxies=proxy.req)
|
||||
return resp.headers.get("Content-Type", "binary/octet-stream")
|
||||
|
||||
def rewrite(current, provider, proxy, ctype):
|
||||
|
Loading…
Reference in New Issue
Block a user