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

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

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/proxied_request_check.html
diff --git a/net/data/websocket/proxied_request_check.html b/net/data/websocket/proxied_request_check.html
new file mode 100644
index 0000000000000000000000000000000000000000..9d6d64edbe1ab769395e852a7163ae46a5f4dc1a
--- /dev/null
+++ b/net/data/websocket/proxied_request_check.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<head>
+<title>test proxied ws connection</title>
+</head>
+<script type="text/javascript">
+// Do connection test and check the headers arrive at the WebSocket.
+
+var protocol = location.protocol.replace('http', 'ws');
+var url = protocol + '//' + location.host + '/echo-request-headers';
+var ws = new WebSocket(url);
+
+ws.onmessage = function(evt)
+{
+ var headers = JSON.parse(evt.data);
+ for (var name in headers) {
+ // The keys in the serialized data are lower cased.
+ if (name.startsWith('proxy-')) {
+ document.title = 'FAIL';
+ return;
+ }
+ }
+
+ // Set document title to 'PASS'. The test observer catches this title changes
+ // to know the result.
+ document.title = 'PASS';
+}
+
+ws.onclose = function()
+{
+ document.title = 'FAIL';
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698