check for none

This commit is contained in:
Roy Olav Purser 2021-05-12 01:08:20 +02:00
parent 832cb49357
commit d080d51287
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -87,7 +87,10 @@ def get_proxy_url(proxy, current, path):
return presp.text return presp.text
def upstream_type(current, proxy): 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") return resp.headers.get("Content-Type", "binary/octet-stream")
def rewrite(current, provider, proxy, ctype): def rewrite(current, provider, proxy, ctype):