From 7b235a6663ac95523eedbe9fbc206dcd06a11ce2 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 13 Dec 2023 21:01:43 +0000 Subject: Update auth cgi to work with python 3.11 --- cgi-bin/auth.cgi | 7 ++----- 1 file 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] -- cgit v1.2.3