Auto merge of #16508 - brainlessdeveloper:fetch-set-origin, r=asajeffrey

Properly set origin of fetch requests

<!-- Please describe your changes on the following line: -->

These changes aim to fix #15247

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15247 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes
- [x] These changes do not require tests because cors is already tested with different origins

These changes require changes in tests, but I need help with that (see comments below).

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16508)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-17 08:29:23 -07:00 committed by GitHub
commit 2bb4f65100
32 changed files with 173 additions and 529 deletions

View file

@ -30,7 +30,7 @@ use net_traits::{CookieSource, NetworkError};
use net_traits::request::{Request, RequestInit, RequestMode, CredentialsMode, Destination};
use net_traits::response::ResponseBody;
use new_fetch_context;
use servo_url::ServoUrl;
use servo_url::{ServoUrl, ImmutableOrigin};
use std::collections::HashMap;
use std::io::{Read, Write};
use std::str::FromStr;
@ -38,6 +38,10 @@ use std::sync::{Arc, Mutex, RwLock, mpsc};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::Receiver;
fn mock_origin() -> ImmutableOrigin {
ServoUrl::parse("http://servo.org").unwrap().origin()
}
fn read_response(reader: &mut Read) -> String {
let mut buf = vec![0; 1024];
match reader.read(&mut buf) {
@ -138,12 +142,12 @@ fn test_check_default_headers_loaded_in_every_request() {
url: url.clone(),
method: Method::Get,
destination: Destination::Document,
origin: url.clone(),
origin: url.clone().origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
let response = fetch(&mut request, None);
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
// Testing for method.POST
let mut post_headers = headers.clone();
@ -157,12 +161,12 @@ fn test_check_default_headers_loaded_in_every_request() {
url: url.clone(),
method: Method::Post,
destination: Destination::Document,
origin: url.clone(),
origin: url.clone().origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
let response = fetch(&mut request, None);
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
let _ = server.close();
}
@ -179,12 +183,12 @@ fn test_load_when_request_is_not_get_or_head_and_there_is_no_body_content_length
method: Method::Post,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
let response = fetch(&mut request, None);
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
let _ = server.close();
}
@ -205,13 +209,13 @@ fn test_request_and_response_data_with_network_messages() {
headers: request_headers,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
let (devtools_chan, devtools_port) = mpsc::channel();
let response = fetch(&mut request, Some(devtools_chan));
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
let _ = server.close();
@ -292,13 +296,13 @@ fn test_request_and_response_message_from_devtool_without_pipeline_id() {
url: url.clone(),
method: Method::Get,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: None,
.. RequestInit::default()
});
let (devtools_chan, devtools_port) = mpsc::channel();
let response = fetch(&mut request, Some(devtools_chan));
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
let _ = server.close();
@ -327,7 +331,6 @@ fn test_redirected_request_to_devtools() {
url: pre_url.clone(),
method: Method::Post,
destination: Destination::Document,
origin: pre_url.clone(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -375,7 +378,7 @@ fn test_load_when_redirecting_from_a_post_should_rewrite_next_request_as_get() {
url: pre_url.clone(),
method: Method::Post,
destination: Destination::Document,
origin: pre_url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -403,7 +406,7 @@ fn test_load_should_decode_the_response_as_deflate_when_response_headers_have_co
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -411,8 +414,9 @@ fn test_load_should_decode_the_response_as_deflate_when_response_headers_have_co
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert_eq!(*response.body.lock().unwrap(),
let internal_response = response.internal_response.unwrap();
assert!(internal_response.status.unwrap().is_success());
assert_eq!(*internal_response.body.lock().unwrap(),
ResponseBody::Done(b"Yay!".to_vec()));
}
@ -432,7 +436,7 @@ fn test_load_should_decode_the_response_as_gzip_when_response_headers_have_conte
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -440,8 +444,9 @@ fn test_load_should_decode_the_response_as_gzip_when_response_headers_have_conte
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert_eq!(*response.body.lock().unwrap(),
let internal_response = response.internal_response.unwrap();
assert!(internal_response.status.unwrap().is_success());
assert_eq!(*internal_response.body.lock().unwrap(),
ResponseBody::Done(b"Yay!".to_vec()));
}
@ -470,7 +475,7 @@ fn test_load_doesnt_send_request_body_on_any_redirect() {
body: Some(b"Body on POST!".to_vec()),
method: Method::Post,
destination: Destination::Document,
origin: pre_url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -495,7 +500,7 @@ fn test_load_doesnt_add_host_to_sts_list_when_url_is_http_even_if_sts_headers_ar
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -504,7 +509,7 @@ fn test_load_doesnt_add_host_to_sts_list_when_url_is_http_even_if_sts_headers_ar
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
assert_eq!(context.state.hsts_list.read().unwrap().is_host_secure(url.host_str().unwrap()), false);
}
@ -525,7 +530,7 @@ fn test_load_sets_cookies_in_the_resource_manager_when_it_get_set_cookie_header_
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
credentials_mode: CredentialsMode::Include,
.. RequestInit::default()
@ -534,7 +539,7 @@ fn test_load_sets_cookies_in_the_resource_manager_when_it_get_set_cookie_header_
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
assert_cookie_for_domain(&context.state.cookie_jar, url.as_str(), Some("mozillaIs=theBest"));
}
@ -565,7 +570,7 @@ fn test_load_sets_requests_cookies_header_for_url_by_getting_cookies_from_the_re
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
credentials_mode: CredentialsMode::Include,
.. RequestInit::default()
@ -574,7 +579,7 @@ fn test_load_sets_requests_cookies_header_for_url_by_getting_cookies_from_the_re
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
}
#[test]
@ -603,7 +608,7 @@ fn test_load_sends_cookie_if_nonhttp() {
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
credentials_mode: CredentialsMode::Include,
.. RequestInit::default()
@ -612,7 +617,7 @@ fn test_load_sends_cookie_if_nonhttp() {
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
}
#[test]
@ -633,7 +638,7 @@ fn test_cookie_set_with_httponly_should_not_be_available_using_getcookiesforurl(
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
credentials_mode: CredentialsMode::Include,
.. RequestInit::default()
@ -642,7 +647,7 @@ fn test_cookie_set_with_httponly_should_not_be_available_using_getcookiesforurl(
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
assert_cookie_for_domain(&context.state.cookie_jar, url.as_str(), Some("mozillaIs=theBest"));
let mut cookie_jar = context.state.cookie_jar.write().unwrap();
@ -667,7 +672,7 @@ fn test_when_cookie_received_marked_secure_is_ignored_for_http() {
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
credentials_mode: CredentialsMode::Include,
.. RequestInit::default()
@ -676,7 +681,7 @@ fn test_when_cookie_received_marked_secure_is_ignored_for_http() {
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
assert_cookie_for_domain(&context.state.cookie_jar, url.as_str(), None);
}
@ -696,7 +701,7 @@ fn test_load_sets_content_length_to_length_of_request_body() {
method: Method::Post,
body: Some(content.to_vec()),
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -704,7 +709,7 @@ fn test_load_sets_content_length_to_length_of_request_body() {
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
}
#[test]
@ -724,7 +729,7 @@ fn test_load_uses_explicit_accept_from_headers_in_load_data() {
method: Method::Get,
headers: accept_headers,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -732,7 +737,7 @@ fn test_load_uses_explicit_accept_from_headers_in_load_data() {
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
}
#[test]
@ -752,7 +757,7 @@ fn test_load_sets_default_accept_to_html_xhtml_xml_and_then_anything_else() {
url: url.clone(),
method: Method::Get,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -760,7 +765,7 @@ fn test_load_sets_default_accept_to_html_xhtml_xml_and_then_anything_else() {
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
}
#[test]
@ -780,7 +785,7 @@ fn test_load_uses_explicit_accept_encoding_from_load_data_headers() {
method: Method::Get,
headers: accept_encoding_headers,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -788,7 +793,7 @@ fn test_load_uses_explicit_accept_encoding_from_load_data_headers() {
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
}
#[test]
@ -807,7 +812,7 @@ fn test_load_sets_default_accept_encoding_to_gzip_and_deflate() {
url: url.clone(),
method: Method::Get,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -815,7 +820,7 @@ fn test_load_sets_default_accept_encoding_to_gzip_and_deflate() {
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
}
#[test]
@ -843,7 +848,7 @@ fn test_load_errors_when_there_a_redirect_loop() {
url: url_a.clone(),
method: Method::Get,
destination: Destination::Document,
origin: url_a.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -886,7 +891,7 @@ fn test_load_succeeds_with_a_redirect_loop() {
url: url_a.clone(),
method: Method::Get,
destination: Destination::Document,
origin: url_a.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -922,7 +927,7 @@ fn test_load_follows_a_redirect() {
url: pre_url.clone(),
method: Method::Get,
destination: Destination::Document,
origin: pre_url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
.. RequestInit::default()
});
@ -931,9 +936,9 @@ fn test_load_follows_a_redirect() {
let _ = pre_server.close();
let _ = post_server.close();
let response = response.to_actual();
assert!(response.status.unwrap().is_success());
assert_eq!(*response.body.lock().unwrap(),
let internal_response = response.internal_response.unwrap();
assert!(internal_response.status.unwrap().is_success());
assert_eq!(*internal_response.body.lock().unwrap(),
ResponseBody::Done(b"Yay!".to_vec()));
}
@ -999,7 +1004,7 @@ fn test_redirect_from_x_to_y_provides_y_cookies_from_y() {
url: url_x.clone(),
method: Method::Get,
destination: Destination::Document,
origin: url_x.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
credentials_mode: CredentialsMode::Include,
.. RequestInit::default()
@ -1008,9 +1013,9 @@ fn test_redirect_from_x_to_y_provides_y_cookies_from_y() {
let _ = server.close();
let response = response.to_actual();
assert!(response.status.unwrap().is_success());
assert_eq!(*response.body.lock().unwrap(),
let internal_response = response.internal_response.unwrap();
assert!(internal_response.status.unwrap().is_success());
assert_eq!(*internal_response.body.lock().unwrap(),
ResponseBody::Done(b"Yay!".to_vec()));
}
@ -1043,7 +1048,7 @@ fn test_redirect_from_x_to_x_provides_x_with_cookie_from_first_response() {
url: url.clone(),
method: Method::Get,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
credentials_mode: CredentialsMode::Include,
.. RequestInit::default()
@ -1052,9 +1057,9 @@ fn test_redirect_from_x_to_x_provides_x_with_cookie_from_first_response() {
let _ = server.close();
let response = response.to_actual();
assert!(response.status.unwrap().is_success());
assert_eq!(*response.body.lock().unwrap(),
let internal_response = response.internal_response.unwrap();
assert!(internal_response.status.unwrap().is_success());
assert_eq!(*internal_response.body.lock().unwrap(),
ResponseBody::Done(b"Yay!".to_vec()));
}
@ -1075,7 +1080,7 @@ fn test_if_auth_creds_not_in_url_but_in_cache_it_sets_it() {
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
credentials_mode: CredentialsMode::Include,
.. RequestInit::default()
@ -1093,7 +1098,7 @@ fn test_if_auth_creds_not_in_url_but_in_cache_it_sets_it() {
let _ = server.close();
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
}
#[test]
@ -1109,7 +1114,7 @@ fn test_auth_ui_needs_www_auth() {
method: Method::Get,
body: None,
destination: Destination::Document,
origin: url.clone(),
origin: mock_origin(),
pipeline_id: Some(TEST_PIPELINE_ID),
credentials_mode: CredentialsMode::Include,
.. RequestInit::default()
@ -1119,7 +1124,7 @@ fn test_auth_ui_needs_www_auth() {
let _ = server.close();
assert_eq!(response.status.unwrap(), StatusCode::Unauthorized);
assert_eq!(response.internal_response.unwrap().status.unwrap(), StatusCode::Unauthorized);
}
#[test]
@ -1142,11 +1147,11 @@ fn test_origin_set() {
url: url.clone(),
method: Method::Post,
body: None,
origin: url.clone(),
origin: url.clone().origin(),
.. RequestInit::default()
});
let response = fetch(&mut request, None);
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
let origin_url = ServoUrl::parse("http://example.com").unwrap();
origin = Origin::new(origin_url.scheme(), origin_url.host_str().unwrap(), origin_url.port());
@ -1156,26 +1161,26 @@ fn test_origin_set() {
method: Method::Get,
mode: RequestMode::CorsMode,
body: None,
origin: origin_url.clone(),
origin: origin_url.clone().origin(),
.. RequestInit::default()
});
*origin_header_clone.lock().unwrap() = Some(origin.clone());
let response = fetch(&mut request, None);
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
// Test Origin header is not set on method Head
let mut request = Request::from_init(RequestInit {
url: url.clone(),
method: Method::Head,
body: None,
origin: url.clone(),
origin: url.clone().origin(),
.. RequestInit::default()
});
*origin_header_clone.lock().unwrap() = None;
let response = fetch(&mut request, None);
assert!(response.status.unwrap().is_success());
assert!(response.internal_response.unwrap().status.unwrap().is_success());
let _ = server.close();
}

View file

@ -12,6 +12,3 @@
[Allow origin: [tab\]undefined//undefined]
expected: FAIL
[Allow origin: _http://web-platform.test:8000___[tab\]_]
expected: FAIL

View file

@ -1,17 +0,0 @@
[origin.htm]
type: testharness
[Allow origin: undefined//undefined]
expected: FAIL
[Allow origin: _undefined//undefined]
expected: FAIL
[Allow origin: _undefined//undefined___[tab\]_]
expected: FAIL
[Allow origin: [tab\]undefined//undefined]
expected: FAIL
[Allow origin: _http://web-platform.test:8000___[tab\]_]
expected: FAIL

View file

@ -1,17 +0,0 @@
[mode-same-origin.any.worker.html]
type: testharness
[Fetch https://web-platform.test:8443/fetch/api/resources/top.txt with same-origin mode]
expected: FAIL
[Fetch http://www1.web-platform.test:8000/fetch/api/resources/top.txt with same-origin mode]
expected: FAIL
[mode-same-origin.any.html]
type: testharness
[Fetch https://web-platform.test:8443/fetch/api/resources/top.txt with same-origin mode]
expected: FAIL
[Fetch http://www1.web-platform.test:8000/fetch/api/resources/top.txt with same-origin mode]
expected: FAIL

View file

@ -3,93 +3,32 @@
[Same domain different port [no-cors mode\]]
expected: FAIL
[Same domain different port [server forbid CORS\]]
expected: FAIL
[Same domain different port [cors mode\]]
expected: FAIL
[Same domain different protocol different port [no-cors mode\]]
expected: FAIL
[Same domain different protocol different port [server forbid CORS\]]
expected: FAIL
[Same domain different protocol different port [cors mode\]]
expected: FAIL
[Cross domain basic usage [no-cors mode\]]
expected: FAIL
[Cross domain basic usage [server forbid CORS\]]
expected: FAIL
[Cross domain basic usage [cors mode\]]
expected: FAIL
[Cross domain different port [no-cors mode\]]
expected: FAIL
[Cross domain different port [server forbid CORS\]]
expected: FAIL
[Cross domain different port [cors mode\]]
expected: FAIL
[Cross domain different protocol [no-cors mode\]]
expected: FAIL
[Cross domain different protocol [server forbid CORS\]]
expected: FAIL
[Cross domain different protocol [cors mode\]]
expected: FAIL
[cors-basic.any.html]
type: testharness
[Same domain different port [no-cors mode\]]
expected: FAIL
[Same domain different port [server forbid CORS\]]
expected: FAIL
[Same domain different port [cors mode\]]
expected: FAIL
[Same domain different protocol different port [no-cors mode\]]
expected: FAIL
[Same domain different protocol different port [server forbid CORS\]]
expected: FAIL
[Same domain different protocol different port [cors mode\]]
expected: FAIL
[Cross domain basic usage [no-cors mode\]]
expected: FAIL
[Cross domain basic usage [server forbid CORS\]]
expected: FAIL
[Cross domain basic usage [cors mode\]]
expected: FAIL
[Cross domain different port [no-cors mode\]]
expected: FAIL
[Cross domain different port [server forbid CORS\]]
expected: FAIL
[Cross domain different port [cors mode\]]
expected: FAIL
[Cross domain different protocol [no-cors mode\]]
expected: FAIL
[Cross domain different protocol [server forbid CORS\]]
expected: FAIL
[Cross domain different protocol [cors mode\]]
expected: FAIL

View file

@ -6,12 +6,11 @@
[Include mode: remote cookies are not sent with local request]
expected: FAIL
[Same-origin mode: cookies are discarded in cors request]
expected: FAIL
[cors-cookies.any.worker.html]
type: testharness
[Include mode: 1 cookie]
expected: FAIL
[Include mode: local cookies are not sent with remote request]
expected: FAIL
@ -21,3 +20,17 @@
[Same-origin mode: cookies are discarded in cors request]
expected: FAIL
[Include mode: 1 cookie]
expected: FAIL
[Include mode: remote cookies are not sent with local request]
expected: FAIL
[Same-origin mode: cookies are discarded in cors request]
expected: FAIL
[Include mode: remote cookies are not sent with other remote request]
expected: FAIL
[Include mode: local cookies are not sent with remote request]
expected: FAIL

View file

@ -3,6 +3,3 @@
[Basic Access-Control-Expose-Headers: * support]
expected: FAIL
[Cannot use * for credentialed fetches]
expected: FAIL

View file

@ -1,68 +1,8 @@
[cors-filtering-worker.html]
type: testharness
[CORS filter on Cache-Control header]
expected: FAIL
[CORS filter on Content-Language header]
expected: FAIL
[CORS filter on Content-Type header]
expected: FAIL
[CORS filter on Expires header]
expected: FAIL
[CORS filter on Last-Modified header]
expected: FAIL
[CORS filter on Pragma header]
expected: FAIL
[CORS filter on Age header]
expected: FAIL
[CORS filter on Server header]
expected: FAIL
[CORS filter on Warning header]
expected: FAIL
[CORS filter on Content-Length header]
expected: FAIL
[CORS filter on Set-Cookie header]
expected: FAIL
[CORS filter on Set-Cookie2 header]
expected: FAIL
[CORS filter on Age header, header is exposed]
expected: FAIL
[CORS filter on Server header, header is exposed]
expected: FAIL
[CORS filter on Warning header, header is exposed]
expected: FAIL
[CORS filter on Content-Length header, header is exposed]
expected: FAIL
[CORS filter on Set-Cookie header, header is exposed]
expected: FAIL
[CORS filter on Set-Cookie2 header, header is exposed]
expected: FAIL
[CORS filter on Set-Cookie header, header is forbidden]
expected: FAIL
[CORS filter on Set-Cookie2 header, header is forbidden]
expected: FAIL
[CORS filter on Set-Cookie header, header is forbidden(credentials = include)]
expected: FAIL
[CORS filter on Set-Cookie2 header, header is forbidden(credentials = include)]
expected: FAIL

View file

@ -1,68 +1,8 @@
[cors-filtering.html]
type: testharness
[CORS filter on Cache-Control header]
expected: FAIL
[CORS filter on Content-Language header]
expected: FAIL
[CORS filter on Content-Type header]
expected: FAIL
[CORS filter on Expires header]
expected: FAIL
[CORS filter on Last-Modified header]
expected: FAIL
[CORS filter on Pragma header]
expected: FAIL
[CORS filter on Age header]
expected: FAIL
[CORS filter on Server header]
expected: FAIL
[CORS filter on Warning header]
expected: FAIL
[CORS filter on Content-Length header]
expected: FAIL
[CORS filter on Set-Cookie header]
expected: FAIL
[CORS filter on Set-Cookie2 header]
expected: FAIL
[CORS filter on Age header, header is exposed]
expected: FAIL
[CORS filter on Server header, header is exposed]
expected: FAIL
[CORS filter on Warning header, header is exposed]
expected: FAIL
[CORS filter on Content-Length header, header is exposed]
expected: FAIL
[CORS filter on Set-Cookie header, header is exposed]
expected: FAIL
[CORS filter on Set-Cookie2 header, header is exposed]
expected: FAIL
[CORS filter on Set-Cookie header, header is forbidden]
expected: FAIL
[CORS filter on Set-Cookie2 header, header is forbidden]
expected: FAIL
[CORS filter on Set-Cookie header, header is forbidden(credentials = include)]
expected: FAIL
[CORS filter on Set-Cookie2 header, header is forbidden(credentials = include)]
expected: FAIL

View file

@ -1,5 +1,32 @@
[cors-multiple-origins-worker.html]
type: testharness
[3 origins allowed, no match]
[3 origins allowed, match the 3rd (http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match the 3rd ("*")]
expected: FAIL
[3 origins allowed, match twice (http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match twice ("*")]
expected: FAIL
[3 origins allowed, match twice ("*" and http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match the 3rd (http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match the 3rd ("*")]
expected: FAIL
[3 origins allowed, match twice (http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match twice ("*")]
expected: FAIL
[3 origins allowed, match twice ("*" and http://web-platform.test:8000)]
expected: FAIL

View file

@ -1,5 +1,32 @@
[cors-multiple-origins.html]
type: testharness
[3 origins allowed, no match]
[3 origins allowed, match the 3rd (http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match the 3rd ("*")]
expected: FAIL
[3 origins allowed, match twice (http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match twice ("*")]
expected: FAIL
[3 origins allowed, match twice ("*" and http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match the 3rd (http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match the 3rd ("*")]
expected: FAIL
[3 origins allowed, match twice (http://web-platform.test:8000)]
expected: FAIL
[3 origins allowed, match twice ("*")]
expected: FAIL
[3 origins allowed, match twice ("*" and http://web-platform.test:8000)]
expected: FAIL

View file

@ -1,59 +0,0 @@
[cors-origin.any.html]
type: testharness
[Cross domain different subdomain [origin KO\]]
expected: FAIL
[Same domain different port [origin KO\]]
expected: FAIL
[Cross domain different port [origin KO\]]
expected: FAIL
[Cross domain different protocol [origin KO\]]
expected: FAIL
[Same domain different protocol different port [origin KO\]]
expected: FAIL
[Cross domain [POST\] [origin KO\]]
expected: FAIL
[Cross domain [HEAD\] [origin KO\]]
expected: FAIL
[CORS preflight [PUT\] [origin KO\]]
expected: FAIL
[Allowed origin: "" [origin KO\]]
expected: FAIL
[cors-origin.any.worker.html]
type: testharness
[Cross domain different subdomain [origin KO\]]
expected: FAIL
[Same domain different port [origin KO\]]
expected: FAIL
[Cross domain different port [origin KO\]]
expected: FAIL
[Cross domain different protocol [origin KO\]]
expected: FAIL
[Same domain different protocol different port [origin KO\]]
expected: FAIL
[Cross domain [POST\] [origin KO\]]
expected: FAIL
[Cross domain [HEAD\] [origin KO\]]
expected: FAIL
[CORS preflight [PUT\] [origin KO\]]
expected: FAIL
[Allowed origin: "" [origin KO\]]
expected: FAIL

View file

@ -1,20 +1,11 @@
[cors-preflight-star.any.html]
type: testharness
[CORS that succeeds with credentials: false; method: GET (allowed: get); header: X-Test,1 (allowed: x-test)]
expected: FAIL
[CORS that succeeds with credentials: false; method: SUPER (allowed: *); header: X-Test,1 (allowed: x-test)]
expected: FAIL
[CORS that succeeds with credentials: false; method: OK (allowed: *); header: X-Test,1 (allowed: *)]
expected: FAIL
[CORS that fails with credentials: true; method: PUT (allowed: *); header: undefined (allowed: )]
expected: FAIL
[CORS that fails with credentials: true; method: PUT (allowed: put); header: undefined (allowed: *)]
expected: FAIL
[CORS that fails with credentials: true; method: GET (allowed: get); header: X-Test,1 (allowed: *)]
expected: FAIL
@ -24,24 +15,12 @@
[cors-preflight-star.any.worker.html]
type: testharness
[CORS that succeeds with credentials: false; method: GET (allowed: get); header: X-Test,1 (allowed: x-test)]
expected: FAIL
[CORS that succeeds with credentials: false; method: SUPER (allowed: *); header: X-Test,1 (allowed: x-test)]
expected: FAIL
[CORS that succeeds with credentials: false; method: OK (allowed: *); header: X-Test,1 (allowed: *)]
expected: FAIL
[CORS that fails with credentials: true; method: PUT (allowed: *); header: undefined (allowed: )]
expected: FAIL
[CORS that fails with credentials: true; method: PUT (allowed: put); header: undefined (allowed: *)]
expected: FAIL
[CORS that fails with credentials: true; method: GET (allowed: get); header: X-Test,1 (allowed: *)]
expected: FAIL
[CORS that fails with credentials: true; method: GET (allowed: *); header: X-Test,1 (allowed: *)]
[CORS that succeeds with credentials: false; method: GET (allowed: get); header: X-Test,1 (allowed: x-test)]
expected: FAIL

View file

@ -3,15 +3,9 @@
[CORS [DELETE\], server allows]
expected: FAIL
[CORS [DELETE\], server refuses]
expected: FAIL
[CORS [PUT\], server allows]
expected: FAIL
[CORS [PUT\], server refuses]
expected: FAIL
[CORS [PATCH\], server allows]
expected: FAIL
@ -33,9 +27,6 @@
[CORS [PUT\] [several headers\], server allows]
expected: FAIL
[CORS [PUT\] [several headers\], server refuses]
expected: FAIL
[CORS [PUT\] [only safe headers\], server allows]
expected: FAIL
@ -45,15 +36,9 @@
[CORS [DELETE\], server allows]
expected: FAIL
[CORS [DELETE\], server refuses]
expected: FAIL
[CORS [PUT\], server allows]
expected: FAIL
[CORS [PUT\], server refuses]
expected: FAIL
[CORS [PATCH\], server allows]
expected: FAIL
@ -75,9 +60,6 @@
[CORS [PUT\] [several headers\], server allows]
expected: FAIL
[CORS [PUT\] [several headers\], server refuses]
expected: FAIL
[CORS [PUT\] [only safe headers\], server allows]
expected: FAIL

View file

@ -1,95 +0,0 @@
[cors-redirect-credentials.any.worker.html]
type: testharness
[Redirect 301 from remote to same remote with user and password]
expected: FAIL
[Redirect 301 from remote to same remote with user]
expected: FAIL
[Redirect 301 from remote to same remote with password]
expected: FAIL
[Redirect 302 from remote to same remote with user and password]
expected: FAIL
[Redirect 302 from remote to same remote with user]
expected: FAIL
[Redirect 302 from remote to same remote with password]
expected: FAIL
[Redirect 303 from remote to same remote with user and password]
expected: FAIL
[Redirect 303 from remote to same remote with user]
expected: FAIL
[Redirect 303 from remote to same remote with password]
expected: FAIL
[Redirect 307 from remote to same remote with user and password]
expected: FAIL
[Redirect 307 from remote to same remote with user]
expected: FAIL
[Redirect 307 from remote to same remote with password]
expected: FAIL
[Redirect 308 from remote to same remote with user and password]
expected: FAIL
[Redirect 308 from remote to same remote with user]
expected: FAIL
[Redirect 308 from remote to same remote with password]
expected: FAIL
[cors-redirect-credentials.any.html]
type: testharness
[Redirect 301 from remote to same remote with user and password]
expected: FAIL
[Redirect 301 from remote to same remote with user]
expected: FAIL
[Redirect 301 from remote to same remote with password]
expected: FAIL
[Redirect 302 from remote to same remote with user and password]
expected: FAIL
[Redirect 302 from remote to same remote with user]
expected: FAIL
[Redirect 302 from remote to same remote with password]
expected: FAIL
[Redirect 303 from remote to same remote with user and password]
expected: FAIL
[Redirect 303 from remote to same remote with user]
expected: FAIL
[Redirect 303 from remote to same remote with password]
expected: FAIL
[Redirect 307 from remote to same remote with user and password]
expected: FAIL
[Redirect 307 from remote to same remote with user]
expected: FAIL
[Redirect 307 from remote to same remote with password]
expected: FAIL
[Redirect 308 from remote to same remote with user and password]
expected: FAIL
[Redirect 308 from remote to same remote with user]
expected: FAIL
[Redirect 308 from remote to same remote with password]
expected: FAIL

View file

@ -63,45 +63,30 @@
[cors-redirect.any.html]
type: testharness
[Redirect 301: cors to same cors]
expected: FAIL
[Redirect 301: cors to another cors]
expected: FAIL
[Redirect 301: cors to same origin]
expected: FAIL
[Redirect 302: cors to same cors]
expected: FAIL
[Redirect 302: cors to another cors]
expected: FAIL
[Redirect 302: cors to same origin]
expected: FAIL
[Redirect 303: cors to same cors]
expected: FAIL
[Redirect 303: cors to another cors]
expected: FAIL
[Redirect 303: cors to same origin]
expected: FAIL
[Redirect 307: cors to same cors]
expected: FAIL
[Redirect 307: cors to another cors]
expected: FAIL
[Redirect 307: cors to same origin]
expected: FAIL
[Redirect 308: cors to same cors]
expected: FAIL
[Redirect 308: cors to another cors]
expected: FAIL