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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-access-control-login.html

Issue 2808753003: Carve out an exception for embedded credentials in XHR. (Closed)
Patch Set: Rebaseline. Created 3 years, 8 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/http/tests/serviceworker/resources/fetch-access-control-login.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-access-control-login.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-access-control-login.html
index 1dad1c82f11487b39a8209d4e9274f2052d40ffb..4152c669da466f96f961a88ea5a5b95930ca1b34 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-access-control-login.html
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-access-control-login.html
@@ -1,16 +1,16 @@
<script>
// Set authentication info
-var port;
-var w;
window.addEventListener("message", function(evt) {
- if (evt.ports[0]) {
- port = evt.ports[0];
+ var port = evt.ports[0];
document.cookie = 'cookie=' + evt.data.cookie;
- w = window.open(window.location.protocol + "//" + evt.data.username + ":" + evt.data.password + "@" + window.location.hostname + ":" + window.location.port + "/serviceworker/resources/fetch-access-control.php?Auth&WINDOW", evt.data.username);
- } else {
- w.close();
- w = null;
- port.postMessage({msg: 'LOGIN FINISHED'});
- }
-}, false);
-</script>
+ var xhr = new XMLHttpRequest();
+ xhr.addEventListener('load', function() {
+ port.postMessage({msg: 'LOGIN FINISHED'});
+ }, false);
+ xhr.open('GET',
+ './fetch-access-control.php?Auth',
+ true,
+ evt.data.username, evt.data.password);
+ xhr.send();
+ }, false);
+</script>

Powered by Google App Engine
This is Rietveld 408576698