Commit graph

212 commits

Author SHA1 Message Date
Ms2ger
b9ad395a61 Set cookies in http_network_fetch. 2016-11-02 09:25:55 +01:00
Ms2ger
f34534740a Pass the entire FetchContext to http_network_fetch. 2016-11-02 09:20:31 +01:00
Ms2ger
28d06ab40a Store the referrer in the Response and return it in Response::metadata(). 2016-11-02 09:20:30 +01:00
Ms2ger
a66f186866 Return a network error Response from http_network_fetch when obtain_response fails. 2016-11-02 09:20:29 +01:00
Ms2ger
784c45a306 Store the NetworkError in network error Responses. 2016-11-02 09:20:28 +01:00
Ms2ger
6af63d6af1 Make the status handling in http_fetch more robust. 2016-11-02 09:20:27 +01:00
Daan Sprenkels
66059904b7 Remove extra spaces in function calls and declarations 2016-10-31 18:11:37 +01:00
Ms2ger
e134871a95 Implement blob url support in the fetch stack. 2016-10-14 14:18:03 +02:00
Ms2ger
fc68e0a6ca Add a FileManager to FetchContext. 2016-10-14 11:30:09 +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
Jan Zerebecki
95a7482d26 Remove same-origin-data-url flag from fetch implementation
The spec removed it. Check the scheme instead, data is always same origin now,
except for workers.
This also updates the comments to make step numbers match the spec.
Closes #13362
2016-10-01 00:27:03 -07:00
Ms2ger
ccfd977076 Avoid a possible deadlock in main_fetch's synchronous code.
On playpen, similar code caused a deadlock on 1.11 stable, and worked fine
on nightly 1.13; it seems safer to avoid the pattern entirely.
2016-09-23 09:36:02 +02:00
Keith Yeung
6fbd2aa5b7 Avoid deadlock in main_fetch 2016-09-21 14:26:09 -07:00
Keith Yeung
07c9cfecec Add FetchMetadata and update corresponding methods 2016-09-21 14:26:03 -07: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
82e45a403f updated basic auth cache to key off of url origin 2016-09-15 22:08:52 -04:00
Malisa Smith
faf32a7cfb dom::Response implementation 2016-09-06 19:58:32 -07:00
bors-servo
f66382f75c Auto merge of #13071 - wdv4758h:cors_preflight_fetch, r=jdm
Solved wrong referrer policy in cors_preflight_fetch

Solved wrong referrer policy in cors_preflight_fetch

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

<!-- 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/13071)
<!-- Reviewable:end -->
2016-08-27 05:20:46 -05:00
Chiu-Hsiang Hsu
3c93ced76a Solved wrong referrer policy in cors_preflight_fetch 2016-08-27 16:02:23 +08:00
hsinewu
1db1a7671e pass request value instead of constant 2016-08-27 12:03:49 +08: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
fc6faf72ee Update Rust to 1.12.0-nightly (1deb02ea6 2016-08-12) 2016-08-13 18:34:44 +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
Aravind Gollakota
bfda32ea00 msg: Rename ReferrerPolicy::NoRefWhenDowngrade NoReferrerWhenDowngrade
This is more consistent with the other variants.
2016-07-15 08:13:57 -07: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
bf99e73cb0 Re-add support for fetching chunks (and thus xhr download progress) 2016-06-10 20:53:40 +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
Manish Goregaokar
2cbc8dee25 Net side of XHR fetch integration 2016-06-10 20:53:15 +05:30
Manish Goregaokar
b5255f011e Revamp Fetch async handling to use a fetch target and done channels 2016-06-10 20:53:10 +05:30
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
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Keith Yeung
7a72981d87 Use read_block in http_network_fetch 2016-05-11 09:34:43 -04:00
Matt Brubeck
c344461017 Move http_loader::Connector to a separate module 2016-05-10 11:20:32 -07:00
Joshua Holmer
8bb740e95e Remove CacheRequestDetails
Fixes #10904
2016-05-02 22:08:16 -04:00
Ramana Venkata
7c14de6d4b Implement fetching file URL's 2016-04-29 16:06:07 +05:30
Daniel Robertson
483f07c8f0
Cleanup CORSCache
Remove the CORSCache trait, CORSCacheSender, CORSCacheThreadMsg, and
CORSCacheThread. Rename BasicCORSCache to CORSCache and keep its old
implementation of CORSCache.
2016-04-27 17:02:54 -04:00
Daniel Robertson
153059c55c
Fix logic for cors cache match
The current logic for a cors cache match does not consider "credentials
is false and request's credentials mode is not "include" or credentials
is true."
2016-04-27 16:39:57 -04:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
bors-servo
d21ff2fa13 Auto merge of #10189 - KiChjang:cors-preflight-fetch, r=jdm
Implement CORS preflight fetch

Fixes #10145.

<!-- 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/10189)
<!-- Reviewable:end -->
2016-04-13 21:28:25 +05:30
Keith Yeung
e42481d0e7 Implement CORS preflight fetch 2016-04-13 11:28:14 -04:00
Nazım Can Altınova
d22d1c4fc1 Removed unused imports from methods.rs 2016-04-09 22:09:11 +03:00
Keith Yeung
32f309c02e Use mime! macro in fetch methods 2016-04-08 11:26:48 -04:00
bors-servo
9f892edd87 Auto merge of #10272 - creativcoder:implement-data-url-fetch, r=jdm
implements data-url fetching

Fixes #10165
jdm mentioned of decoupling the, payload loading mechanism to data_loader.rs. So accordingly a `decoder` method has been added to data_loader.

<!-- 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/10272)
<!-- Reviewable:end -->
2016-04-01 15:12:30 +05:30
Rahul Sharma
3e74164e5f implements data-url fetching 2016-04-01 09:49:08 +05:30
faineance
7c45a4fea0 change changes effecting verbosity 2016-03-27 13:54:41 +01:00