Commit f97b2dbd authored by Tiago Peixoto's avatar Tiago Peixoto

netzschleuder.py: simplify token

parent bfd0999e
......@@ -45,9 +45,7 @@ def open_ns_file(url, token=None):
if token is None:
req = urllib.request.Request(url)
else:
req = urllib.request.Request(url,
headers={"WWW-Authenticate" :
f"Authorization: Bearer {token}"})
req = urllib.request.Request(url, headers={"WWW-Authenticate" : token})
with urllib.request.urlopen(req) as f:
yield f
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment