diff options
Diffstat (limited to 'cgi-bin')
-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] |