From d080d512875c4cc517b9e60a2c767e91488add71 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 12 May 2021 01:08:20 +0200 Subject: [PATCH] check for none --- stream.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stream.py b/stream.py index b892000..5d4f0aa 100755 --- a/stream.py +++ b/stream.py @@ -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):