Commit graph

235 commits

Author SHA1 Message Date
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
783f754d09 Log debug messages when devtools is not notified about a HTTP request. 2016-11-08 14:49:45 +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
d777016b3a Use set_default_accept_language in fetch_with_cors_cache. 2016-11-07 19:42:16 +01:00
Raghav
e0e734fa7f Remove return and resolve merge conflicts
Since last execution statement is the value which is returned, return
keyword has been removed from method strict_origin and
strict_origin_when_cross_origin.

Merge conflicts in Cargo.lock has been handled
2016-11-04 13:27:08 -04: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
Alan Jeffrey
f3993d99b9 Lookup frames by frame_id, not pipeline_id. 2016-11-03 15:39:51 -05:00
Ms2ger
b9ad395a61 Set cookies in http_network_fetch. 2016-11-02 09:25:55 +01:00
Ms2ger
2d430050a8 Only pass the headers to set_cookies_from_response.
I will need to call it from the fetch code, which does not have a
HttpResponse on hand.

Also, rename the function to match its new signature.
2016-11-02 09:20:32 +01:00
Ms2ger
6bd5d2716b Avoid some unnecessary clones when handling cookies. 2016-10-20 09:38:47 +02: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
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
0bcd04d2ab store basic auth in cache on redirect response 2016-09-15 22:08:52 -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
6cc862d0c6 Lessen pressure on the thread-local RNG
When loading HTTP requests, initialise the request ID only if devtools
are used, to lessen the pressure put on the RNG initialisation.

This tentatively fixes #11100 on OS X.
2016-08-16 10:12:33 +02: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
UK992
06142b37b8 Support tinyfiledialogs on Windows 2016-07-25 14:43:06 +02:00
Johann Hofmann
8e3593aa67
Improve page load error information
Fixes #8640.

This commit adds a neterror page that displays really really basic
information about what went wrong with your request, which is an
improvement over the current state of blank page.

It also fixes the problem of certificate validation errors not
triggering the cert error page, since for some reason the function
string seems to have turned lowercase.
2016-07-21 16:06:13 +02:00
Rahul Sharma
eff3e01df0 make resource_thread talk to sw-manager 2016-07-18 19:06:48 +05:30
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
bors-servo
4b78b9adab Auto merge of #12416 - canaltinova:referrer, r=jdm
Implement Document.referrer

<!-- Please describe your changes on the following line: -->
---
<!-- 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 #12389 (github issue number if applicable).

<!-- Either: -->
- [X] 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. -->

<!-- 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/12416)
<!-- Reviewable:end -->
2016-07-14 11:55:44 -07:00
Nazım Can Altınova
d6c1f7b5e3 Implement Document.referrer 2016-07-14 21:35:39 +03:00
Aravind Gollakota
eeccb75fc1 net: Add "origin" and "same-origin" referrer policies, replacing "origin-only". 2016-07-08 00:01:24 -07:00
bors-servo
c8b048e368 Auto merge of #12050 - johannhof:brotli, r=jdm
Switch to a faster Brotli crate

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

---
<!-- 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 #11933.

<!-- Either: -->
- [x] These changes do not require tests (I hope) because no new behavior was introduced

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12050)
<!-- Reviewable:end -->
2016-07-03 18:32:15 -07:00
bors-servo
194fb3e199 Auto merge of #12190 - frewsxcv:mime-renaming, r=jdm
Minor MIME renaming and aliasing cleanup.

<!-- 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/12190)
<!-- Reviewable:end -->
2016-07-03 11:07:12 -07:00
Corey Farwell
6c02a576cf Rename MIMEClassifier to match Rust acronym naming conventions.
e.g. `std::net::TcpStream`
2016-07-02 17:12:46 -04:00
Corey Farwell
22928f50ac Refactor util::prefs operations to be methods on static struct. 2016-07-02 16:43:39 -04:00
Johann Hofmann
7890440d72
Switch to a faster Brotli crate 2016-07-01 20:15:32 +02:00
Josh Matthews
94df389031 Print out useful SSL-related information on SSL error page. 2016-06-29 14:21:12 -04:00
Manish Goregaokar
9deecd793c
Review fixes 2016-06-11 11:49:40 +05:30
Manish Goregaokar
fd6f9bd411 Test fixes; update for changes in spec 2016-06-10 20:55:25 +05:30
Manish Goregaokar
f4e3e8e38e Re-support gzip 2016-06-10 20:53:47 +05:30
Manish Goregaokar
909b99f1a6 Modify request headers for fetch 2016-06-10 20:53:43 +05:30
Manish Goregaokar
6e29b872d7 Test fixes:
- Hack to stop hitting unreachable on referer
 - add fetch_done to make sync work
 - Make datauris work by setting the response URI, spec bug
 - Allow for empty bodies
 - Make request bodies work (pass to http, fix fencepost in iter count)
2016-06-10 20:53:36 +05:30
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
Josh Matthews
7bf2e19437 Make the net monitor panel in FF's devtools show meaningful output.
0) Advertise support for the network monitor in the initial protocol communication.
1) Only notify the developer tools server about the final request in an HTTP transaction.
2) Add timing information for connecting to the HTTP server and sending the HTTP request.
3) Reduce duplication between various networkEventUpdate structures by creating a helper function
that merges two JSON structures together. This also corrects the JSON structure so the devtools
client interprets the output correctly.
4) Calculate various header size fields correctly.
5) Remove unnecessary usize->u32 casts by making the appropriate fields usize.
6) Add header values to request and response header messages.
7) Support triggering page reloads via the devtools client.
2016-06-06 00:51:36 +01:00
Rebecca
687d0cd7c3 Add meta-referrer support for documents 2016-06-02 21:48:09 -04:00
Anthony Ramine
a09773e819 Handle origin when blocking content 2016-05-30 13:17:43 +02:00
Josh Matthews
074fc4a5e1 Process content blocker rules in the HTTP loader. 2016-05-30 13:17:42 +02:00
Josh Matthews
50fea8554e Read the content blocking rules and make them available to the HTTP loader. 2016-05-30 10:54:52 +02:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00