diff options
Diffstat (limited to 'tests/wpt/web-platform-tests/fetch/api/resources/authentication.py')
-rw-r--r-- | tests/wpt/web-platform-tests/fetch/api/resources/authentication.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/fetch/api/resources/authentication.py b/tests/wpt/web-platform-tests/fetch/api/resources/authentication.py new file mode 100644 index 00000000000..a06d179e58e --- /dev/null +++ b/tests/wpt/web-platform-tests/fetch/api/resources/authentication.py @@ -0,0 +1,15 @@ +def main(request, response): + user = request.auth.username + password = request.auth.password + + if user == "user" and password == "password": + return "Authentication done" + + realm = "test" + if "realm" in request.GET: + realm = request.GET.first("realm") + + return ((401, "Unauthorized"), + [("WWW-Authenticate", 'Basic realm="' + realm + '"')], + "Please login with credentials 'user' and 'password'") + |