Index: third_party/WebKit/LayoutTests/external/wpt/fetch/api/resources/authentication.py |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/resources/authentication.py b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/resources/authentication.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a06d179e58ebbbb0b4b97f71c475d4927d3a5cf8 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/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'") |
+ |