Граф коммитов

291 Коммитов

Автор SHA1 Сообщение Дата
Ramana Venkata 3b1084584e servo: Merge #10896 - Implement fetching file URL's (from vramana:basic_fetch_file); r=KiChjang
closes #10166

Source-Repo: https://github.com/servo/servo
Source-Revision: fbf98214c91ce3bb52c32ec4a5e121023843f1eb
2016-04-29 22:54:20 -07:00
Daniel Robertson 2650d582c6 servo: Merge #10867 - Fix logic for cors cache match (from danlrobertson:sandbox); r=KiChjang
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."

I could have missed something, but `CacheRequestDetails::credentials` is set to true if credentials mode is "include", and false otherwise. So `(!cors_cache.credentials && !cors_req.credentials) || cors_cache.credentials` would be directly following the spec, but unless I'm mistaken `cors_cache.credentials || !cors_req.credentials` is logically the same.

Fixes: #10525
Source-Repo: https://github.com/servo/servo
Source-Revision: 3d38a60cee8a2e19ae8f04df7c2374fc9d97999c
2016-04-28 13:36:05 -07:00
Corey Farwell 56bef9c48f servo: Merge #10869 - DRY out `StreamedResponse::from_http_response` (from frewsxcv:dry); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 88020e9151d3cdb6a2e01b62ac0c093b8f693123
2016-04-27 04:23:34 -07:00
Corey Farwell 497a8b7fd3 servo: Merge #10868 - Add `NetworkError::LoadCancelled` variant (from frewsxcv:loadcancelled); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: ad77d40360f4ccb0a1249d86e5a48357f74295ea
2016-04-27 01:26:05 -07:00
Simon Sapin 2f882b0cfb servo: Merge #10857 - Simplify TOML syntax (from servo:toml); r=nox
* Sections like `[dependencies.foo]` can be entries in a `[dependencies]` section with the `{key = value}` syntax.
* Per-target dependencies can be expressed with more general `cfg(…)` conditions instead of exact target triples: https://github.com/rust-lang/cargo/pull/2328

Source-Repo: https://github.com/servo/servo
Source-Revision: 2729864af73d62719ea0fd55cef417c43bdd951e
2016-04-26 15:46:37 -07:00
Sagar Muchhal 736fef2862 servo: Merge #10767 - Added Store Command to ImageCache Task (from akhan7:command); r=jdm
Implemented last bullet of [Image conformance student project: Initial Steps](https://github.com/servo/servo/wiki/Image-load-conformance-student-project)

Source-Repo: https://github.com/servo/servo
Source-Revision: 47efbea666ed60e09804d57f42a8348c30815907
2016-04-26 07:40:18 -07:00
Daniel eebee42d38 servo: Merge #10800 - read cookie_jar, hsts_list, auth_cache, and local_data from file if profile_dir option is present (from DDEFISHER:read_profile_dir_from_file); r=frewsxcv
Last step in Persistent sessions student project

"check for the presence of the profile directory command-line option in the ResourceThread constructor and look for files that will contain serialized versions of the previous steps. If they exist, populate the appropriate fields with deserialized versions of the file contents."

Also populated local_data in StorageManager constructor

I am not sure if the handling of decoding and encoding the Option Tm type was done in the cleanest way here.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7a582b4bf9bdaeff34c8c813a92f35226ced72f5
2016-04-25 18:10:40 -07:00
Corey Farwell ab49393c3c servo: Merge #10785 - Refactor `LoadErrorType` to not require a `String` for every type (from frewsxcv:loaderrortype-nostring); r=jdm
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 81f6e70a623a6f11535322ed2ef954eafaf8c70c
2016-04-25 14:37:44 -07:00
Rebecca c6a0cc3d7f servo: Merge #10696 - Referer header (from rebstar6:referrerPolicy); r=jdm
PR1 for https://github.com/servo/servo/issues/10311

This puts the code and data structures in place to set the Referer header based on the Referrer Policy for a given document. Note that document:: get_referrer_policy() always returns the 'No Referrer' option, so for now, this should have no impact on production code, and that policy requires that the Referer header is not added.

Later PRs will determine the policy and edit that get_referrer_policy() accordingly.

Source-Repo: https://github.com/servo/servo
Source-Revision: 34900814fca3b21fbb27bed58d4f4af8a8e307e9
2016-04-25 13:52:01 -07:00
Simon Sapin 15f5299fe5 servo: Merge #9840 - Update to rust-url 1.0 (from servo:url-1.0); r=asajeffrey
**Do not merge yet:** rust-url 1.0 is not published yet and may still get breaking changes. The goal of this PR for now is to demonstrate API usage.

Depends on:

* <s>https://github.com/servo/rust-url/pull/176</s>
* <s>https://github.com/alexcrichton/cookie-rs/pull/42</s>
* <s>https://github.com/hyperium/hyper/pull/740</s>
* https://github.com/cyderize/rust-websocket/pull/70
* https://github.com/jgraham/webdriver-rust/pull/28

Source-Repo: https://github.com/servo/servo
Source-Revision: 84ab7e9fe8f4a6528995eff3eb6e814cb724c364
2016-04-23 11:28:31 -07:00
Zbynek Winkler c70e781908 servo: Merge #10751 - Report lines starting with && in tidy (from zwn:tidy-start-operator); r=Wafflespeanut
Partial implementation of the issue #10692 (the easy part).

Source-Repo: https://github.com/servo/servo
Source-Revision: d926b5d3762a101d5280266f806f2b979f73b695
2016-04-22 10:40:06 -07:00
Daniel 0bb60ea590 servo: Merge #10661 - write cookie_jar, hsts_list, auth_cache to file if profile_dir option is present (from DDEFISHER:master); r=jdm
For Persistent sessions student project

"if the profile directory command-line option is present when the ResourceThread is instructed to exit, serialize the data contained in cookie_storage, hsts_list, and the new HTTP authorization cache, and write the serialized data in separate files inside the profile directory."

and

"perform the same serialization on shutdown for local_data in storage_thread.rs, which represents the LocalStorage API."

Source-Repo: https://github.com/servo/servo
Source-Revision: 75d99eec0ff02718f1ec8d1b6fd58fff7c2d6fb3
2016-04-21 03:22:56 +05:01
Josh Matthews 39037852d3 servo: Merge #9942 - Moving the error handling out of network loader (from jdm:load_error); r=ms2ger
Rebase of #8851. Fixes #8678. Fixes #9944.

Source-Repo: https://github.com/servo/servo
Source-Revision: f051028ee8cd93168b1abe3742929d43d19cb002
2016-04-20 21:50:22 +05:01
Corey Farwell 939c774f41 servo: Merge #10725 - A few minor `net` component cleanups (from frewsxcv:net-cleanup); r=KiChjang
Source-Repo: https://github.com/servo/servo
Source-Revision: bebc1dc859192d7fdcfc53e550cbf51343f4375a
2016-04-20 05:01:59 +05:01
Corey Farwell 9ab0516061 servo: Merge #10695 - Avoid unnecessary `net_traits::LoadData` clone (from frewsxcv:no-clone); r=KiChjang
Source-Repo: https://github.com/servo/servo
Source-Revision: 407c43fadedab02614e5d5c6b5a9d55e7632e991
2016-04-19 10:41:18 +05:01
Corey Farwell d9806fb51f servo: Merge #10672 - Improvements to network preferences, HTTP redirection limiting (from frewsxcv:net-network); r=KiChjang
Source-Repo: https://github.com/servo/servo
Source-Revision: 80662f1e4e3054415700f1d82896bd76626b022d
2016-04-19 03:37:25 +05:01
Corey Farwell c43335a056 servo: Merge #10640 - Cleanup code regarding mimesniff 'apache bug' (from frewsxcv:apache-flag); r=KiChjang
Source-Repo: https://github.com/servo/servo
Source-Revision: 6edcad206d0888da1ba845e80d020c488c747131
2016-04-18 23:47:12 +05:01
Corey Farwell 60a86d0dbb servo: Merge #10666 - Refactor, cleanup HSTS related code (from frewsxcv:hsts-cleanup); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 317629d86e323fca8603ce278e76e1be7758dd3a
2016-04-17 23:21:13 +05:01
Corey Farwell 8c9ff73738 servo: Merge #10662 - Make `read_resource_file` param simpler and more idiomatic (from frewsxcv:resource-param); r=jdm
`<P: AsRef<Path>>` is also what `File::open` uses as a generic type for
the parameter.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9935e82de6854b334e3b7ce3bd2816c736c38650
2016-04-17 10:11:30 +05:01
Josh Matthews 6873f38158 servo: Merge #10650 - Disable tinyfiledialogs on non-OS X and Linux platforms (from jdm:disabletfd); r=KiChjang
I haven't been able to fix the appveyor build yet, so this gives us back a usable Windows build.

Source-Repo: https://github.com/servo/servo
Source-Revision: cc290c6e8a3a8576e57e48dd21fa74aa0e1cf3a9
2016-04-17 02:21:19 +05:01
Corey Farwell e2bedbee0f servo: Merge #10629 - Flatten a couple `net` implementations (from frewsxcv:flatten); r=Ms2ger
Working on some of the TLS related code in `net` and tried to clean up a couple implementations along the way.

Source-Repo: https://github.com/servo/servo
Source-Revision: f39ec2b15e7db394c8ca375dd1b85081d6d790a5
2016-04-15 18:21:39 +05:01
Josh Matthews d524089dcb servo: Merge #10555 - Remove unnecessary indirection in HTTP unit tests (from jdm:http_response_refactor); r=ms2ger
Many of the HTTP unit tests use a custom request factory as well as a custom request that contained test logic. This is unnecessarily convoluted, and exists solely because the complete set of headers was unavailable until the request body was sent. These patches restructure the header manipulations so that the headers are available when the request object is created, allowing the test logic to move into the test factories, and enabling the deletion of almost all of the test request types.

Source-Repo: https://github.com/servo/servo
Source-Revision: eb78e21fbe05215a798af954bbe82bd41071a94b
2016-04-15 12:15:59 +05:01
Daniel e8c0268d64 servo: Merge #10328 - 401 authorization UI then restart request/save successful auth creds (from DDEFISHER:master); r=jdm
Step 7 of the NCSU student project Implement HTTP authorization UI

> make an authorization UI appear when a 401 HTTP response is received (StatusCode::Unauthorized) - in load in http_loader.rs, right before trying to process an HTTP redirection, use the new tinyfiledialogs library to make two prompts appear (username and password), then restart the request with the new authorization value present applied. If an authorization value was present and the response is successful, add the credentials to the authorization cache.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7bd23815184bfa675bde040231199722c703d2f0
2016-04-15 07:32:23 +05:01
Keith Yeung 3f162e1b39 servo: Merge #10189 - Implement CORS preflight fetch (from KiChjang:cors-preflight-fetch); r=jdm
Fixes #10145.

Source-Repo: https://github.com/servo/servo
Source-Revision: d21ff2fa137155e8db649c100886962300a58140
2016-04-13 20:59:25 +05:01
Nazım Can Altınova b732a4f93f servo: Merge #10501 - Removed unused imports from methods.rs (from canaltinova:master); r=KiChjang
Fixes #10500

Source-Repo: https://github.com/servo/servo
Source-Revision: 5a3d6850c686695a6a4c4f0e78bc19da6dfaddb2
2016-04-10 00:52:04 +05:01
Keith Yeung 0fc85c69ce servo: Merge #10471 - Use mime! macro in fetch methods (from KiChjang:mime-macro); r=emilio
Source-Repo: https://github.com/servo/servo
Source-Revision: 217e45006bc04a932650cbfda52388ce1d2a5698
2016-04-08 21:31:15 +05:01
Ms2ger 540ad4129b servo: Merge #10453 - Update uuid (from Ms2ger:uuid); r=KiChjang
Source-Repo: https://github.com/servo/servo
Source-Revision: 5cf89fea48fb1fc58fd665384cbaa2060decff31
2016-04-07 15:49:20 +05:01
Rahul Sharma 707ce17295 servo: Merge #10272 - implements data-url fetching (from creativcoder:implement-data-url-fetch); r=jdm
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9f892edd87441393e5de00790a5abb7fc93a09de
2016-04-01 14:43:30 +05:01
Anthony Ramine c569102ac6 servo: Merge #10240 - Bump websocket to 0.16.1 (from servo:websocket); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 074c7e8aa0cdfbd9ff558a0189e90e60f879a29b
2016-03-29 09:26:17 +05:01
faineance f3988ea1b8 servo: Merge #10222 - Use self.0 instead of destructuring single item tuple structs (from faineance:master); r=KiChjang
Closes #9698.

Source-Repo: https://github.com/servo/servo
Source-Revision: b97ffffb48080a0b4769f8609a27a68145042945
2016-03-28 03:43:31 +05:01
Connor Brewster fefe65bc63 servo: Merge #10188 - Add Http Global State Object (from cbrewster:http-global-state); r=jdm
This adds a new HttpState object which holds common http state(#10175). This reduces the amount of work that is required to add extra things to the Http state.

The HttpState object currently holds:
```
hsts_list: Arc::new(RwLock::new(HSTSList::new())),
cookie_jar: Arc::new(RwLock::new(CookieStorage::new())),
auth_cache: Arc::new(RwLock::new(HashMap::new())),
```

Source-Repo: https://github.com/servo/servo
Source-Revision: d82f97a9cd9f208a4f331d5991486ae7f0108c08
2016-03-26 18:37:52 +05:01
Stjepan Glavina fdd7bf05a2 servo: Merge #10154 - Fix #10147: Correctly handle flag local_urls_only (from stjepang:fix-local-urls-only-10147); r=KiChjang
In function Request::fetch_main, flag local_urls_only (if set)
should allow fetching local urls only. Before this change, the flag had
the inverse behaviour.

Fixes #10147.
Test with: `./mach test-unit -p net fetch::test_fetch_with_local_urls_only`

Source-Repo: https://github.com/servo/servo
Source-Revision: 38e8c923b519f488cd0614ff9409997998418cc7
2016-03-25 12:13:48 +05:01
Daniel 814e6a9a37 servo: Merge #10111 - add auth cache to resources + set auth header from it if url does not have creds (from DDEFISHER:master); r=jdm
initial attempt of

- in resource_thread.rs, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an Arc<Rwlock<>> value, to enable sharing it between threads)
- in modify_request_headers in http_loader.rs, implement the remaining pieces of step 12(13?) of the appropriate specification using this new authorization cache.

 for the NCSU student project Implement HTTP authorization UI and persistent sessions.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7f944afee88bb2ab13de4f37118af14d40328f7f
2016-03-24 23:25:13 +05:01
Stjepan Glavina 50512a2a04 servo: Merge #10167 - Fix fetching about:blank (from stjepang:fix-aboutblank-body); r=KiChjang
When fetching about:blank, response body should be the empty byte
sequence.
Spec: https://fetch.spec.whatwg.org/#concept-basic-fetch

Before this change, response body would be set to `ResponseBody::Empty`,
and then fetching would result in an infinite loop at step 19 in fn
`main_fetch` (methods.rs).

r? @KiChjang

Source-Repo: https://github.com/servo/servo
Source-Revision: 446783f7b6f0b55164b3b3c3e8be90c2b392cf97
2016-03-24 16:11:19 +05:01
Corey Farwell bd8adcc5f2 servo: Merge #9788 - Use external 'threadpool' crate, remove in-tree utility (from servo:threadpool); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 9e0c73c8f3b1941b01c705066815303d59221ffd
2016-03-19 06:17:56 +05:01
Ms2ger 156edc0b82 servo: Merge #10070 - Disallow unsafe code in net and net_traits (from Ms2ger:unsafe-net); r=KiChjang
Source-Repo: https://github.com/servo/servo
Source-Revision: e551ea73226404152e02c3445f4f91e639bf66ce
2016-03-18 16:40:24 +05:01
Anthony Ramine ace9b5c608 servo: Merge #10055 - Bump serde to 0.7 (from servo:serde); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 7a9dc577617b442ff0fe07eaa683207234c519ee
2016-03-17 17:58:36 +05:01
Ms2ger f23fc0b384 servo: Merge #9951 - Use a match rather than unwrap() in main_fetch (from Ms2ger:fetch-unwrap); r=ecoal95
Source-Repo: https://github.com/servo/servo
Source-Revision: 20992c9df9463b9d5426b1eb4b00381fd2cf35c5
2016-03-11 07:58:19 +05:01
Anthony Ramine 3ba3376dfd servo: Merge #9943 - Preliminary bumps for bumping Serde (from servo:serde-preliminaries); r=jdm
We need to bump webrender before being able to bump Serde, but we also needs these bumps, so let's include them ASAP first because bumping a lot of things is always a pain.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0f526054ebfa164ca2545d881b8392a744af7870
2016-03-10 00:21:36 +05:01
Ms2ger 725d1d8308 servo: Merge #9940 - Fix warnings in the fetch code (from Ms2ger:fetch-warnings); r=asajeffrey
Source-Repo: https://github.com/servo/servo
Source-Revision: 0359fb8ed8c2bd509a69335822ef7c8feb081994
2016-03-09 20:22:30 +05:01
Bob 7f3584b186 servo: Merge #9780 - correctly send secure cookies after hsts url match (from bobthekingofegypt:github_hsts_bug); r=jdm
Fixes #8100, where sites in the hsts list were not recieving secure
cookies if the site was originally loading using a plain http url.

Source-Repo: https://github.com/servo/servo
Source-Revision: 162e89d8c6f19204e653b8d1fa83663ee710be15
2016-03-09 14:44:52 +05:01
Ms2ger 921864aeef servo: Merge #9923 - Make Response::new() an inherent method (from Ms2ger:response-new); r=jdm
There is no real reason to put this in an extension trait.

Source-Repo: https://github.com/servo/servo
Source-Revision: ebe7d9ebfb28d484ff0cce4e70cb8809f5867af5
2016-03-08 21:56:57 +05:01
Nikki f2cb1a2b2f servo: Merge #9850 - Set response.body Asynchronously In Fetch (from nikkisquared:2_async_2_furious); r=jdm
Following having finished making Fetch asynchronous, response.body should be set asynchronously, since it's the major goal of calling Fetch. So far, I've made the body wrapped in Arc<Mutex<>>, and I've wrapped a new thread around the part where it's set. I've also discovered that the fetch_async function makes step 8 of Main Fetch obsolete, and I've commented it appropriately.

I'm currently having a hard time with the thread for setting response.body, though. @jdm suggested I have the body set continually, block by block, but my implementation for that runs so slow that I can't finish running my fetch test suite in reasonable time. @KiChjang pointed out that a lot of the lag is due to how response.body currently stores everything inside a Vec. Changing the storage container seems to be both necessary and beyond the scope of the time I have to work on this.

Source-Repo: https://github.com/servo/servo
Source-Revision: fee7cb179ee7ba2f159d87af07afaf0cd99a2161
2016-03-08 04:16:25 +05:01
Ms2ger 4bdf8a7018 servo: Merge #9892 - ImageCache cleanup (from Ms2ger:imagecache); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 1330e7e58f3da6a6fa855d9d44350873ea38c2b7
2016-03-07 21:01:30 +05:01
Anthony Ramine 1b34a11fda servo: Merge #9888 - Update to Rust 2016-03-05 (from servo:rustup); r=Manishearth
Blocked by https://github.com/Manishearth/rust-tenacious/pull/14.

Source-Repo: https://github.com/servo/servo
Source-Revision: 743e0c9c878a78da873fed4edaa9c8284b2fd12d
2016-03-06 16:04:42 +05:01
Corey Farwell ccfd41c9c3 servo: Merge #9857 - Indicate components should not be published to crates.io (from servo:publish-false); r=ecoal95
http://doc.crates.io/manifest.html#the-publish--field-optional

Source-Repo: https://github.com/servo/servo
Source-Revision: 633f0414aaa177e439528f0fa848a41bc0fc094a
2016-03-04 01:08:14 +05:01
Nikki 509851641c servo: Merge #9753 - Make Fetch Protocol Asynchronous (from nikkisquared:async_fetch); r=jdm
I'm working on making it possible to run Fetch Asynchronously, as required for some steps, such as Main Fetch. It looks like somebody has already laid some groundwork for that, with a AsyncFetchListener trait and two async fetch functions defined, which I'm building on top of.

So far, as a sort of proof of concept, I've written a test to asynchronously retrieve a fetch response, which uses a simple function to check if the fetch response is complete or not. I'd like to be checked if I'm on the right path, to see if I need to rework anything so far, and what my next step can be.

Source-Repo: https://github.com/servo/servo
Source-Revision: 22ce878edc22360af7391694efc9e5668116d3fb
2016-03-02 01:20:29 +05:01
Chandler Abraham d0a763a23f servo: Merge #9768 - disallow restricted XMLHttpRequest header prefixes (from jdm:add_disallowed_prefixes); r=jdm
Rebased from #9376.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4a7d234510d5a5f6b2b960a84f70a7260e1fc0a9
2016-02-27 21:40:46 +05:01
Keith Yeung 6119a986b6 servo: Merge #9675 - Update fetch attributes to match the new spec (from KiChjang:fetch-attributes); r=jdm
This should make fetch match the spec more closely.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4e244b16dd3c050a8d6b24ee9209caf116462317
2016-02-27 19:53:22 +05:01
Sam Gibson 2de2442957 servo: Merge #9757 - Trigger WebSocket error event (from jdm:websocket-errors-rebase); r=jdm
Trigger a WebSocket error after receiving an invalid message from the server. Rebased from #8868. Fixes #7861.

Source-Repo: https://github.com/servo/servo
Source-Revision: 26b40afe237f97ebd81d537e8ed1201c7c1e4011
2016-02-26 13:45:06 +05:01