1
0
Fork 0
firefox/testing/web-platform/tests/fetch/api/resources/authentication.py
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

14 lines
462 B
Python

def main(request, response):
user = request.auth.username
password = request.auth.password
if user == b"user" and password == b"password":
return b"Authentication done"
realm = b"test"
if b"realm" in request.GET:
realm = request.GET.first(b"realm")
return ((401, b"Unauthorized"),
[(b"WWW-Authenticate", b'Basic realm="' + realm + b'"')],
b"Please login with credentials 'user' and 'password'")