summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2023-12-13 21:01:43 +0000
committerVincent Sanders <vince@kyllikki.org>2023-12-13 21:01:43 +0000
commit7b235a6663ac95523eedbe9fbc206dcd06a11ce2 (patch)
treee97a05c2976f66ed0bbe99eac0bdebe648ec6d55
parentab72029ee2894eba9ac454ec916442a0099fa46f (diff)
downloadnetsurf-test-master.tar.gz
netsurf-test-master.tar.bz2
Update auth cgi to work with python 3.11HEADmaster
-rwxr-xr-xcgi-bin/auth.cgi7
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]