aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/tests/fetch.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove referrer policy from document (#34263)shanehandley2024-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | * Remove the referrer policy from document and rely on its policy container Signed-off-by: Shane Handley <shanehandley@fastmail.com> * Make ReferrerPolicy non-optional, instead using a new enum value to represent the empty string case Signed-off-by: Shane Handley <shanehandley@fastmail.com> * Fix clippy issue Signed-off-by: Shane Handley <shanehandley@fastmail.com> * Fix usage of Option<ReferrerPolicy> in unit test Signed-off-by: Shane Handley <shanehandley@fastmail.com> --------- Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* net: Start reducing number of IPCs channels used for fetch with a ↵Martin Robinson2024-10-161-220/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FetchThread` (#33863) Instead of creating a `ROUTER` for each fetch, create a fetch thread which handles all incoming and outcoming fetch requests. Now messages involving fetches carry a "request id" which indicates which fetch is being addressed by the message. This greatly reduces the number of file descriptors used by fetch. In addition, the interface for kicking off fetches is simplified when using the `Listener` with `Document`s and the `GlobalScope`. This does not fix all leaked file descriptors / mach ports, but greatly eliminates the number used. Now tests can be run without limiting procesess on modern macOS systems. Followup work: 1. There are more instances where fetch is done using the old method. Some of these require more changes in order to be converted to the `FetchThread` approach. 2. Eliminate usage of IPC channels when doing redirects. 3. Also eliminate the IPC channel used for cancel handling. 4. This change opens up the possiblity of controlling the priority of fetch requests. Fixes #29834. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Implement fetch metadata headers (#33830)Simon Wülker2024-10-161-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement sec-fetch-dest header Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement "is same site" algorithm Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement remaining sec-fetch-* headers Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix casing of header names Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix handling Destination::None in sec-fetch-dest This also removes the comment about wanting to upgrade to a newer content-security-protocol version because the csp doesn't implement the "empty" case. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Remove colon from spec comment Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Adjust expected default headers Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix test expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Create HttpStatus to safely deal with HTTP responses status. (#33581)webbeef2024-09-291-6/+6
| | | Signed-off-by: webbeef <me@webbeef.org>
* make protocol handlers registrable (#33104)webbeef2024-08-221-0/+4
| | | Signed-off-by: webbeef <me@webbeef.org>
* DevTools: Replace camel case variable names (#32726)eri2024-07-081-2/+2
| | | | | | | | | * refactor: rename to snake case * refactor: more renaming * chore: format * chore: clean
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* Backout `Host`-header related change from #32024. (#32093)Philip Lamb2024-04-161-9/+0
| | | #32024 broke a different set of nginx sites, and a more sophisticated fix for the case of a missing HTTP 1.1 `Host` header is required.
* Fixes for HTTP header compliance. (#32024)Philip Lamb2024-04-111-6/+15
| | | | | - Fix 400 errors from nginx in response to Servo requests by implementing conformant albeit non-normative removal of whitespace from `Accept` and `Accept-Language` HTTP headers. (To match behaviour of Firefox, Safari, and Chrome) https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2 - Provide `Host` header as REQUIRED by HTTP protocol https://www.rfc-editor.org/rfc/rfc9110#field.host - Update tests.
* clippy: fix warnings in components/net (#31564)eri2024-03-101-4/+4
| | | | | | | * clippy: fix some warnings in components/net * fix: review comments * fix: tidy
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-21/+20
| | | | | * strict imports formatting * Reformat all imports
* Switch to rustls and webpki-roots (#30025)Martin Robinson2023-08-081-63/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change replaces OpenSSL with rustls and also the manually curated CA certs file with webpki-roots (effectively the same thing, but as a crate). Generally speaking the design of the network stack is the same. Changes: - Code around certificate overrides needed to be refactored to work with rustls so the various thread-safe list of certificates is refactored into `CertificateErrorOverrideManager` - hyper-rustls takes care of setting ALPN protocols for HTTP requests, so for WebSockets this is moved to the WebSocket code. - The safe set of cypher suites is chosen, which seem to correspond to the "Modern" configuration from [1]. This can be adjusted later. - Instead of passing a string of PEM CA certificates around, an enum is used that includes parsed Certificates (or the default which reads them from webpki-roots). - Code for starting up an SSL server for testing is cleaned up a little, due to the fact that the certificates need to be overriden explicitly now. This is due to the fact that the `webpki` crate is more stringent with self-signed certificates than SSL (CA certificates cannot used as end-entity certificates). [2] 1. https://wiki.mozilla.org/Security/Server_Side_TLS 2. https://github.com/briansmith/webpki/issues/114 Fixes #7888. Fixes #13749. Fixes #26835. Fixes #29291.
* Update uuidMartin Robinson2023-06-261-1/+1
| | | | | This is required to use the new version of gleam and update ipc-channels without duplicating the dependency in the future.
* Upgrade HyperNaveen Gattu2022-01-161-1/+1
|
* Non-blocking network IONaveen Gattu2021-12-231-7/+20
|
* Disable fetch tests on windows.Josh Matthews2021-05-271-2/+1
|
* Don't error on unused imports.Josh Matthews2021-05-271-0/+2
|
* Disable more unit tests for windows.Josh Matthews2021-05-271-0/+2
|
* Make url for "client" referrer mandatoryMatthias Deiml2020-06-171-50/+173
|
* net: Add unit test for accepting a self-signed cert.Josh Matthews2020-06-091-3/+92
|
* check http_state in determine_request_referrerAlexandrov Sergey2020-05-191-27/+37
|
* add a fetch token for blob urlsGregory Terzian2020-02-211-0/+3
|
* add a core resource thread-poolGregory Terzian2020-02-141-5/+11
|
* file: and about: are now opaque-filtered responsesPatrick Shaughnessy2020-02-111-9/+28
|
* Fix HSTSJan Andre Ikenmeyer2020-01-071-1/+64
|
* Let hyper automatically add a host header for HTTP/1Jan Andre Ikenmeyer2019-12-161-9/+1
|
* Add ALPN and signature algorithms to OpenSSL configJan Andre Ikenmeyer2019-11-301-14/+7
|
* Move ResourceFetchTiming into ArcJaved Nissar2019-09-181-1/+2
| | | | | | | | | | | The purpose of this commit is to ensure that the Response object has access to Timing updates as previously the Response object simply stored a ResourceFetchTiming struct so updates on ResourceFetchTiming that were not explicitly done on the Response would not be passed down. The references to ServoArc are added because Response uses servo_arc::Arc rather than std::sync::Arc as is used elsewhere. So, we've switched those other places to servo_arc::Arc instead of switching Response to std::sync::Arc.
* Upgrade headers, headers-core, and hyper_serde.Josh Matthews2019-06-131-6/+3
|
* create uuid before sending PromoteMemory messageRussell Cousineau2019-03-181-4/+3
|
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-49/+31
|
* Add comment about incorrect tests for file url range requests. Fmt and ↵Fernando Jiménez Moreno2018-11-261-1/+2
| | | | manifest update
* Use crossbeam channel instead of servo channel. Fix rebase issues and add ↵Fernando Jiménez Moreno2018-11-261-2/+1
| | | | comment
* Adapt fetch blob test to new way of fetching in chunksFernando Jiménez Moreno2018-11-261-5/+37
|
* refactored performance timing to align with updated specddh2018-11-201-7/+10
| | | | | | | | | | | | refactoring with ResourceFetchMetadata implemented deprecated window.timing functionality created ResourceTimingListener trait fixed w3c links in navigation timing updated include.ini to run resource timing tests on ci
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Update crossbeam-channel to 0.3Bastien Orivel2018-11-181-9/+9
|
* Update uuidBastien Orivel2018-11-091-1/+1
|
* Reorder importsPyfisch2018-11-061-9/+16
|
* Format remaining filesPyfisch2018-11-061-31/+49
|
* Sort `use` statementsSimon Sapin2018-11-061-3/+3
|
* `cargo fix --edition`Simon Sapin2018-11-061-4/+4
|
* Rustfmt net cratePyfisch2018-11-031-99/+251
|
* Update hyper to 0.12Bastien Orivel2018-11-011-228/+184
|
* Replace mpsc with crossbeam/servo channel, update ipc-channelSimon Sapin2018-09-121-9/+8
| | | | Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
* Automatically provide a resource reader for testsPaul Rouget2018-04-301-28/+0
|
* test(net): update test casesOJ Kwon2018-04-271-5/+4
|
* test(net): update test casesOJ Kwon2018-04-271-1/+2
|
* delegate resource reading to embedderPaul Rouget2018-04-271-13/+36
|
* Use specific assertion for net fetch testsCYBAI2018-01-261-3/+3
|