mirror of
https://github.com/servo/servo.git
synced 2025-06-24 00:54:32 +01:00
15 lines
452 B
Python
15 lines
452 B
Python
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'")
|
|
|