Commit f97b2dbd authored by Tiago Peixoto's avatar Tiago Peixoto simplify token

parent bfd0999e
...@@ -45,9 +45,7 @@ def open_ns_file(url, token=None): ...@@ -45,9 +45,7 @@ def open_ns_file(url, token=None):
if token is None: if token is None:
req = urllib.request.Request(url) req = urllib.request.Request(url)
else: else:
req = urllib.request.Request(url, req = urllib.request.Request(url, headers={"WWW-Authenticate" : token})
headers={"WWW-Authenticate" :
f"Authorization: Bearer {token}"})
with urllib.request.urlopen(req) as f: with urllib.request.urlopen(req) as f:
yield 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