Commit graph

127 commits

Author SHA1 Message Date
Ms2ger
04ffeea3c5 Rewrite test_redirect_from_x_to_y_provides_y_cookies_from_y. 2016-11-23 17:51:04 +01:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Ms2ger
56dd6417e6 Remove the network.http.redirection-limit preference.
The Fetch standard defines this value as twenty; there is no good reason to
allow changing that at runtime.
2016-11-14 14:44:08 +01:00
Ms2ger
65602de403 Add a successful test for a redirect loop. 2016-11-10 13:13:31 +01:00
Ms2ger
581c6dfe1b Rewrite test_load_errors_when_there_a_redirect_loop. 2016-11-10 12:57:19 +01:00
Ms2ger
bced313c47 Rewrite test_load_sets_default_accept_encoding_to_gzip_and_deflate. 2016-11-10 11:34:48 +01:00
Ms2ger
195774436b Rewrite test_load_uses_explicit_accept_encoding_from_load_data_headers. 2016-11-10 11:32:31 +01:00
Ms2ger
e12a6d7f4e Rewrite test_load_sets_default_accept_to_html_xhtml_xml_and_then_anything_else. 2016-11-10 11:26:54 +01:00
Ms2ger
6319d7cb99 Rewrite test_load_uses_explicit_accept_from_headers_in_load_data. 2016-11-10 11:22:23 +01:00
Ms2ger
5a02586341 Rewrite test_load_sets_content_length_to_length_of_request_body. 2016-11-10 11:18:22 +01:00
Ms2ger
c229a0116e Rewrite test_when_cookie_received_marked_secure_is_ignored_for_http. 2016-11-10 11:06:23 +01:00
Ms2ger
982c59662c Rewrite test_cookie_set_with_httponly_should_not_be_available_using_getcookiesforurl. 2016-11-10 11:06:22 +01:00
Ms2ger
52258e2282 Rewrite test_load_sends_cookie_if_nonhttp. 2016-11-10 11:01:08 +01:00
Ms2ger
f1f090ca81 Rewrite test_load_sets_requests_cookies_header_for_url_by_getting_cookies_from_the_resource_manager. 2016-11-10 11:01:07 +01:00
Ms2ger
5bf90c563c Rewrite test_load_sets_cookies_in_the_resource_manager_when_it_get_set_cookie_header_in_response. 2016-11-10 11:01:05 +01:00
bors-servo
89c46369a2 Auto merge of #14151 - servo:assert_cookie_for_domain, r=jdm
Clarify assert_cookie_for_domain.

<!-- 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/14151)
<!-- Reviewable:end -->
2016-11-10 02:29:44 -06:00
Ms2ger
2744227e13 Rewrite test_load_doesnt_add_host_to_sts_list_when_url_is_http_even_if_sts_headers_are_present. 2016-11-09 17:51:17 +01:00
Ms2ger
f03a6001de Rewrite test_load_doesnt_send_request_body_on_any_redirect.
Note that it is necessary to use POST here; using GET will cause an error in
hyper, which enforces the rule that GET requests don't have a body.
2016-11-09 17:51:15 +01:00
Ms2ger
ba86d8576d Rewrite test_load_should_decode_the_response_as_gzip_when_response_headers_have_content_encoding_gzip. 2016-11-09 17:51:13 +01:00
Ms2ger
4fe105b8e1 Rewrite test_load_should_decode_the_response_as_deflate_when_response_headers_have_content_encoding_deflate. 2016-11-09 17:51:12 +01:00
Ms2ger
90dd7c922a Rewrite test_load_when_redirecting_from_a_post_should_rewrite_next_request_as_get. 2016-11-09 17:51:11 +01:00
Ms2ger
d31188f5a9 Clarify assert_cookie_for_domain. 2016-11-09 15:36:53 +01:00
Ms2ger
00e23a4c57 Rewrite test_redirected_request_to_devtools. 2016-11-08 16:15:22 +01:00
Ms2ger
9b1e153b31 Rewrite test_request_and_response_message_from_devtool_without_pipeline_id. 2016-11-08 11:44:39 +01:00
Ms2ger
42f6e9a8e6 Rewrite test_request_and_response_data_with_network_messages. 2016-11-08 11:37:42 +01:00
Ms2ger
06567e1d5b Rewrite test_load_when_request_is_not_get_or_head_and_there_is_no_body_content_length_should_be_set_to_0. 2016-11-08 09:52:22 +01:00
bors-servo
4a7ea72429 Auto merge of #14114 - servo:fetch-unit-http, r=jdm
Start using fetch for the HTTP unit tests.

<!-- 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/14114)
<!-- Reviewable:end -->
2016-11-07 22:04:27 -06:00
Ms2ger
b403e0004b Rewrite test_check_default_headers_loaded_in_every_request using fetch. 2016-11-07 19:42:17 +01:00
bors-servo
dd34b2a335 Auto merge of #14059 - mrnayak:refPolicy, r=nox
Network Security : Implement StrictOrigin and StrictOriginWhenCrossOr…

This pull request contains commit implementing initial steps for Improving Network Security project. As part of initial steps referer policy enums for strict-origin and strict-origin-when-cross-origin have been added to [hyper](https://github.com/hyperium/hyper/pull/943). Unit tests and additional logic has been added to handle these policies. Since enum changes are available on hyper version 0.9.11. We had to update hyper version to 0.9.11.

Hyper 0.9.11 depends on num_cpus 1.1.0. To avoid different version of num_cpus. We have updated rayon version from 0.4.0 to 0.4.3. Cargo.toml of util, style, geckolib, stylo component has been updated to use num_cpus version 1.1.0 instead of 0.2.2.

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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

…igin

Referer policy strict-origin and strict-origin-when-cross-origin changes have been implemented. Relevant unit test cases have been added. Enum for RefererPolicy has been added to hyper codebase and v 0.9.11 of hyper contains these changes.

This commit also contains changes related to upgrade of hyper from v0.9.10 to v0.9.11. Other dependencies changed are rayon, utils, num_cpus.

<!-- 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/14059)
<!-- Reviewable:end -->
2016-11-07 04:37:35 -06:00
Ms2ger
a888f075a1 Privatize the http_loader module. 2016-11-06 12:18:39 +01:00
Raghav
26dac98546 Code review comments and upstream merge conflicts
Incorporated code review comments in components/net/http_loader.rs
Resolved merge conflicts in cargo.lock file. Updated ReferrerPolicy in
lib.rs
2016-11-04 11:18:22 -04:00
Ms2ger
277c6d0154 Move ReferrerPolicy to net_traits. 2016-11-04 10:43:37 +01:00
Raghav
c24aa56377 Network Security : Implement StrictOrigin and StrictOriginWhenCrossOrigin
Referer policy strict-origin and strict-origin-when-cross-origin changes have been implemented. Relevant unit test cases have been added. Enum for RefererPolicy has been added to hyper codebase and v 0.9.11 of hyper contains these changes.

This commit also contains changes related to upgrade of hyper from v0.9.10 to v0.9.11. Other dependencies changed are rayon, utils, num_cpus.
2016-11-04 03:17:04 -04:00
Corey Farwell
60afad1b61 Migrate user agent string to Cow<'static, str>.
In most scenarios, where the user of Servo will not override the default
user agent, the user agent can be a `&'static str`. But since we allow
for customization, we currently use a `String` to represent the user
agent. This commit migrates the user agent to be represented as a
`Cow<'static, str>`, which (at the cost of ergonomics) prevents
unnecessary allocations whenever cloning the user agent string in the
scenario the user doesn't override the user agent.
2016-10-10 16:34:20 -04:00
Alan Jeffrey
f53408df80 IFrame elements now manage FrameIds rather than the constellation. 2016-10-07 14:11:32 -05:00
bors-servo
8ccfffaa77 Auto merge of #13294 - 6112:referrer-typo-fix, r=jdm
Fix most typoes for: "referer" -> "referrer"

Replace most uses of the word "referer" with "referrer", except for `hyper::header::Referer`. Also update the unit tests to compile & pass after those changes.

---
<!-- 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 #13286

<!-- Either: -->
- [ ]  There are tests for these changes OR
- [X] These changes do not require tests because they're only typo fixes.

<!-- 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/13294)
<!-- Reviewable:end -->
2016-09-16 15:43:54 -05:00
Nicolas
924136ee0c Fix most typoes for: "referer" -> "referrer" 2016-09-16 12:40:17 -04:00
Bryan Gilbert
715682c3a8 removed race condition possibility from auth cache test & fixed up test errors 2016-09-16 11:55:53 -04:00
Bryan Gilbert
82e45a403f updated basic auth cache to key off of url origin 2016-09-15 22:08:52 -04:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Malisa Smith
faf32a7cfb dom::Response implementation 2016-09-06 19:58:32 -07:00
Anthony Ramine
7ad51dcd7a Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +02:00
ddh
db808ca75d Added devtools support to fetch for XHR + Manish's XHR ident fix
added unit test for request fetch with devtools

added devtools/fetch test
2016-07-29 11:20:38 +01:00
mrmiywj
a2b6c3a0da send requests that are redirected to devtools
add unit test
2016-07-27 22:57:25 +08:00
Rahul Sharma
1e6293ea1d Integrate service worker manager thread 2016-07-16 23:29:44 +05:30
Aravind Gollakota
bfda32ea00 msg: Rename ReferrerPolicy::NoRefWhenDowngrade NoReferrerWhenDowngrade
This is more consistent with the other variants.
2016-07-15 08:13:57 -07:00
Aravind Gollakota
eeccb75fc1 net: Add "origin" and "same-origin" referrer policies, replacing "origin-only". 2016-07-08 00:01:24 -07:00
Corey Farwell
22928f50ac Refactor util::prefs operations to be methods on static struct. 2016-07-02 16:43:39 -04:00
bors-servo
2ae8a70e2b Auto merge of #11692 - jdm:language, r=Manishearth
Add a default Accept-Language header to HTTP requests.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11008
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11692)
<!-- Reviewable:end -->
2016-06-10 05:52:37 -05:00
Josh Matthews
c8bf60de57 Add a default Accept-Language header to HTTP requests. 2016-06-10 08:58:20 +01:00