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

Side by Side Diff: chrome/test/data/extensions/api_test/cross_origin_xhr/background_page/test.js

Issue 2775763002: Block 'ftp:' subresource requests from non-'ftp:' pages. (Closed)
Patch Set: Rebaseline. 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/cross_origin_xhr/content_script/test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 chrome.test.getConfig(function(config) { 5 chrome.test.getConfig(function(config) {
6 6
7 function rewriteURL(url) { 7 function rewriteURL(url) {
8 var isFtp = /^ftp:/i.test(url); 8 var isFtp = /^ftp:/i.test(url);
9 var port = isFtp ? config.ftpServer.port : config.testServer.port; 9 var port = isFtp ? config.ftpServer.port : config.testServer.port;
10 return url.replace(/PORT/, port); 10 return url.replace(/PORT/, port);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 function noSubdomain() { 71 function noSubdomain() {
72 doReq("http://b.com", true); 72 doReq("http://b.com", true);
73 }, 73 },
74 function disallowedSubdomain() { 74 function disallowedSubdomain() {
75 doReq("http://foob.com", false); 75 doReq("http://foob.com", false);
76 }, 76 },
77 // TODO(asargent): Explicitly create SSL test server and enable the test. 77 // TODO(asargent): Explicitly create SSL test server and enable the test.
78 // function disallowedSSL() { 78 // function disallowedSSL() {
79 // doReq("https://a.com", false); 79 // doReq("https://a.com", false);
80 // }, 80 // },
81 function allowedFtpHostAllowed() { 81 function allowedFtpHostDisallowed() {
82 doReq('ftp://127.0.0.1', true); 82 doReq('ftp://127.0.0.1', false);
83 }, 83 },
84 function disallowedFtpHostDisallowed() { 84 function disallowedFtpHostDisallowed() {
85 doReq('ftp://this.host.is.not.whitelisted', false); 85 doReq('ftp://this.host.is.not.whitelisted', false);
86 } 86 }
87 ]); 87 ]);
88 }); 88 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/cross_origin_xhr/content_script/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698