Allow XHR to fetch about: and data: URLs.

This was intended to fix #8015 but the tests are all still failing as of
this commit.
This commit is contained in:
Eitan Mosenkis 2015-12-04 00:03:05 +02:00 committed by Dongie Agnir
parent c4208e67b7
commit ae56187d48
2 changed files with 14 additions and 5 deletions

View file

@ -626,7 +626,8 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
load_data.url.clone(),
mode,
load_data.method.clone(),
combined_headers);
combined_headers,
true);
match cors_request {
Ok(None) => {
let mut buf = String::new();
@ -1301,7 +1302,8 @@ impl XMLHttpRequest {
global: GlobalRef) -> ErrorResult {
let cors_request = match cors_request {
Err(_) => {
// Happens in case of cross-origin non-http URIs
// Happens in case of unsupported cross-origin URI schemes.
// Supported schemes are http, https, data, and about.
self.process_partial_response(XHRProgress::Errored(
self.generation_id.get(), Error::Network));
return Err(Error::Network);