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
* 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
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
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
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
Partial implementation of the issue #10692 (the easy part).
Source-Repo: https://github.com/servo/servo
Source-Revision: d926b5d3762a101d5280266f806f2b979f73b695
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
`<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
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
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
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
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
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
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
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
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
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
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
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
There is no real reason to put this in an extension trait.
Source-Repo: https://github.com/servo/servo
Source-Revision: ebe7d9ebfb28d484ff0cce4e70cb8809f5867af5
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
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
This should make fetch match the spec more closely.
Source-Repo: https://github.com/servo/servo
Source-Revision: 4e244b16dd3c050a8d6b24ee9209caf116462317
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