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

Unified Diff: tools/testing/dart/http_server.dart

Issue 12625006: Fixing IE10 CORS test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « tests/html/xhr_cross_origin_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/http_server.dart
diff --git a/tools/testing/dart/http_server.dart b/tools/testing/dart/http_server.dart
index d065e0bcaac33f64a9dda61127ccee40c4d58c7f..75daee5d988ce150f6853e1dc7eb7d5df3f391f3 100644
--- a/tools/testing/dart/http_server.dart
+++ b/tools/testing/dart/http_server.dart
@@ -268,10 +268,20 @@ class TestingServers {
Path path,
File file) {
if (allowedPort != -1) {
- var origin = new Uri(request.headers.value('Origin'));
- // Allow loading from http://*:$allowedPort in browsers.
- var allowedOrigin =
+ var headerOrigin = request.headers.value('Origin');
+ var allowedOrigin;
+ if (headerOrigin != null) {
+ var origin = new Uri(headerOrigin);
+ // Allow loading from http://*:$allowedPort in browsers.
+ allowedOrigin =
'${origin.scheme}://${origin.domain}:${allowedPort}';
+ } else {
+ // IE10 appears to be bugged and is not sending the Origin header
+ // when making CORS requests to the same domain but different port.
+ allowedOrigin = '*';
kustermann 2013/03/16 22:41:19 I think this is not the right approach: You know
+ }
+
+
response.headers.set("Access-Control-Allow-Origin", allowedOrigin);
response.headers.set('Access-Control-Allow-Credentials', 'true');
} else {
« no previous file with comments | « tests/html/xhr_cross_origin_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698