diff options
author | Vincent Sanders <vince@kyllikki.org> | 2023-12-13 21:01:43 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2023-12-13 21:01:43 +0000 |
commit | 7b235a6663ac95523eedbe9fbc206dcd06a11ce2 (patch) | |
tree | e97a05c2976f66ed0bbe99eac0bdebe648ec6d55 | |
parent | ab72029ee2894eba9ac454ec916442a0099fa46f (diff) | |
download | netsurf-test-master.tar.gz netsurf-test-master.tar.bz2 |
-rwxr-xr-x | cgi-bin/auth.cgi | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cgi-bin/auth.cgi b/cgi-bin/auth.cgi index 5eebf4e..3f49135 100755 --- a/cgi-bin/auth.cgi +++ b/cgi-bin/auth.cgi @@ -1,16 +1,13 @@ #!/usr/bin/python3 -import cgi -import cgitb -cgitb.enable() - import os +from urllib.parse import parse_qs from base64 import b64decode auth = os.getenv("HTTP_AUTHORIZATION") query = os.getenv("QUERY_STRING") or "user=foo&pass=bar&realm=NetSurf+Authentication+Test" -query = cgi.parse_qs(query) +query = parse_qs(query) username = query.get("user", ["foo"])[0] password = query.get("pass", query.get("password", ["bar"]))[0] realm = query.get("realm", ["NetSurf Authentication Test"])[0] |