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

Unified Diff: net/data/websocket/connect_to.html

Issue 336263005: Map WebSocket URL schemes to HTTP URL schemes for auth purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace accidentally removed #include <string> Created 6 years, 5 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: net/data/websocket/connect_to.html
diff --git a/net/data/websocket/connect_check.html b/net/data/websocket/connect_to.html
similarity index 64%
copy from net/data/websocket/connect_check.html
copy to net/data/websocket/connect_to.html
index 8d8e815b114c8822fbf517eef375ea1575733ce0..05c653fc5d2ab9a333efea5b4c5eee83a03bbe07 100644
--- a/net/data/websocket/connect_check.html
+++ b/net/data/websocket/connect_to.html
@@ -3,8 +3,16 @@
<head>
<title>test ws connection</title>
<script type="text/javascript">
-var protocol = location.protocol.replace('http', 'ws');
-var url = protocol + '//' + location.host + '/echo-with-no-extension';
+
+var href = window.location.href;
+var queryBegin = href.indexOf('?url=');
+if (queryBegin == -1) {
+ console.log("Failed to find ?url= in URL");
+ document.title = 'FAIL';
+ throw "FAILURE";
+}
+var url = href.slice(queryBegin + 5);
+
// Do connection test.
var ws = new WebSocket(url);

Powered by Google App Engine
This is Rietveld 408576698