Skip to content
Snippets Groups Projects
Verified Commit ab30c7d1 authored by Duncan Macleod's avatar Duncan Macleod
Browse files

ui: handle port numbers in default token_audience

add default audiences with and without the port suffix
parent 5cc5b92a
No related branches found
No related tags found
No related merge requests found
Pipeline #380873 passed
......@@ -115,10 +115,13 @@ def get(url, *args, **kwargs):
if url.startswith("http://") and requests.__version__ < "2.15.0":
# workaround https://github.com/psf/requests/issues/4025
kwargs.setdefault("cert", False)
kwargs.setdefault("token_audience", [
"{0.scheme}://{0.netloc}".format(urlparse(url)),
scheme, netloc = urlparse(url)[:2]
host = netloc.split(":", 1)[0] # remove the port
kwargs.setdefault("token_audience", list({
f"{scheme}://{netloc}",
f"{scheme}://{host}",
"ANY",
])
}))
kwargs.setdefault("token_scope", "read:/frames")
return _get(url, *args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment