Commit graph

376 commits

Author SHA1 Message Date
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
Rahul Sharma
3766cd1673 adding interface for custom responses 2016-05-20 12:11:56 +05:30
Josh Matthews
9e8cf19e51 Add timeline markers for HTTP requests, JS evaluation, and HTML parsing. 2016-05-18 08:02:42 -05:00
Matt Brubeck
c344461017 Move http_loader::Connector to a separate module 2016-05-10 11:20:32 -07:00
Josh Matthews
cb63ad6c87 Add the requesting URL to the 401 prompt. Only show the 401 prompt when the WWW-Authenticate header is present. 2016-05-03 13:19:42 -04:00
bors-servo
88020e9151 Auto merge of #10869 - frewsxcv:dry, r=jdm
DRY out `StreamedResponse::from_http_response`.

<!-- 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/10869)
<!-- Reviewable:end -->
2016-04-27 04:23:34 -07:00
Corey Farwell
87b54ef685 DRY out StreamedResponse::from_http_response. 2016-04-27 01:00:50 -04:00
Corey Farwell
55c2f93740 Add NetworkError::LoadCancelled variant. 2016-04-27 00:25:27 -04:00
bors-servo
81f6e70a62 Auto merge of #10785 - frewsxcv:loaderrortype-nostring, r=jdm
Refactor `LoadErrorType` to not require a `String` for every type.

Some of the `LoadErrorType` like `LoadCancelled` don't need a `String`
associated with the type since the variant is self-explanatory.

There are some variants that don't need an associated `String`, but that
can be cleaned up in a later refactor. Also, `net_traits::NetworkError`
currently requires a `String`, but that can potentially also be
refactored away too.

<!-- 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/10785)
<!-- Reviewable:end -->
2016-04-25 14:37:44 -07:00
Corey Farwell
2675d9d1ff Refactor LoadErrorType to not require a String for every type.
Some of the `LoadErrorType` like `LoadCancelled` don't need a `String`
associated with the type since the variant is self-explanatory.

There are some variants that don't need an associated `String`, but that
can be cleaned up in a later refactor. Also, `net_traits::NetworkError`
currently requires a `String`, but that can potentially also be
refactored away too.
2016-04-25 17:10:33 -04:00