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