mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 06:08:24 +02:00
Automatic update from web-platform-testsRun autopep8 on *.py in cors, fetch and xhr (#11116) ``` find cors fetch xhr -name '*.py' | xargs autopep8 --in-place --max-line-length 1000 ``` Then manually pick the "good" changes, ignoring some whitespace stuff. -- wpt-commits: 15b8e55fa2a0fbf0851cb8e0846e0320e319c852 wpt-pr: 11116
14 lines
451 B
Python
14 lines
451 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'")
|