Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/resources/authentication.py

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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'")
+

Powered by Google App Engine
This is Rietveld 408576698