diff options
author | Ms2ger <ms2ger@gmail.com> | 2016-02-01 09:19:46 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2016-02-01 17:25:22 +0100 |
commit | 73bc5cf1b80992a2920c169dcdd66f06e2386adf (patch) | |
tree | 0820b05524e7d34197110c5365dafd8cec818c81 /tests/wpt/web-platform-tests/fetch/api/resources/authentication.py | |
parent | 6b1a08c051f3be4b7bc7e6200053dfa530ecd106 (diff) | |
download | servo-73bc5cf1b80992a2920c169dcdd66f06e2386adf.tar.gz servo-73bc5cf1b80992a2920c169dcdd66f06e2386adf.zip |
Update web-platform-tests to revision 7f2f85a88f434798e9d643427b34b05fab8278c6
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'") + |