aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/tests
Commit message (Collapse)AuthorAgeFilesLines
* Update FetchTaskTarget to propagate CSP violations. (#36409)Tim van der Lippe13 days3-0/+6
| | | | | | | | | | | | | | | | | | It also updates the FetchResponseListener to process CSP violations to ensure that iframe elements (amongst others) properly generate the CSP events. These iframe elements are used in the Trusted Types tests themselves and weren't propagating the violations before. However, the tests themselves are still not passing since they also use Websockets, which currently aren't using the fetch machinery itself. That is fixed as part of [1]. [1]: https://github.com/servo/servo/issues/35028 --------- Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* libservo: Remove a couple `EmbedderMethods` (#36276)Martin Robinson2025-04-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | - Remove `EmbedderMethods::get_user_agent_string`. This is now part of the `Preferences` data structure, which should allow it to be per-`WebView` in the future. - Remove `EmbedderMethods::get_version_string`. This was used to include some data along with WebRender captures about the Servo version. This isn't really necessary and it was done to replace code in the past that output the WebRender version, so also isn't what the original code did. I think we can just remove this entirely. The idea with these changes is that `EmbedderMethods` can be removed in a followup and the rest of the methods can be added to `ServoDelegate`. These two methods are ones that cannot be added to a delegate as they are used during `Servo` initialization. Testing: There is currently no testing for libservo. These changes are meant as preparation for adding a suite of `WebView` unit tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-036-208/+280
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Don’t prompt user for credentials for non-Navigate request (#35664)Isaac Marovitz2025-02-261-1/+52
| | | Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
* libservo: Convert `intercept_web_resource_load` into `load_web_resource` ↵Martin Robinson2025-02-212-16/+12
| | | | | | | | | | | | | | | | | | | | | (#35564) Rework the `WebViewDelegate::intercept_web_resource_load` into `WebViewDelegate::load_web_resource` and clean up internal messaging. The main thing here is adding objects which manage the response to these delegate methods. Now we have `WebResourceLoad` and `InterceptedWebResourceLoad` which make it much harder to misuse the API. In addition, the internal messaging for this is cleaned up. Canceling and finishing the load are unrelated to the HTTP body so they are no longer subtypes of an HttpBodyData message. Processing of messages is made a bit more efficient by collecting all body chunks in a vector and only flattening the chunks at the end. Finally, "interceptor" is a much more common spelling than "intercepter" so I've gone ahead and made this change everywhere. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Add a delegate method for HTTP authentication (#35400)Martin Robinson2025-02-102-19/+18
| | | | | | | | | | | | Add a delegate method for HTTP authentication and a related `AuthenticationRequest` object that carries with it the URL as well as whether or not the authentication request is for a proxy or not. This is now separate from the prompt API because requesting authentication doesn't necessarily involve prompting -- this is an implementation detail of the embedder. In addition, the internal bits are cleaned up slightly. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Modify the checks for upgrade-request algorithm (#35357)Shubham Gupta2025-02-071-2/+0
| | | Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
* deps: Upgrade to `webrender@0.66` (#35325)Martin Robinson2025-02-071-1/+1
| | | | | | | | | In addition to some small API changes, this downstream version of WebRender no longer depends on a very old version of time. This is the last step toward removing the dependency on `time0.1`. The review for this commit should also include: https://github.com/servo/webrender/commit/9f552bebab81a73e62068c42d94be2f9c0586ce4 Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Add support for Upgrade request to a potentially trustworthy URL. (#34986)Shubham Gupta2025-02-051-0/+2
| | | | | | | | | | | | | | | | * Add support for Upgrade request to a potentially trustworthy URL. Signed-off-by: Shubham Gupta <shubham13297@gmail.com> * script: Support inheritable insecure request policy in documents and workers. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Shubham Gupta <shubham13297@gmail.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Shubham Gupta <shubham.gupta@chromium.org> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* servoshell: Migrate to egui-file-dialog from tinyfiledialogs (#34823)chickenleaf2025-02-041-1/+1
| | | | | | This is the first step toward completely replacing tinyfiledialogs with an egui-based solution. Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Use aws-lc-rs as rust-tls provider (#35106)Jonathan Schwender2025-01-301-1/+1
| | | Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Include `WebViewId` into EmbedderMsg variants where possible (#35211)Delan Azabani2025-01-306-77/+79
| | | | | | | | | | | | | | | | | `EmbedderMsg` was previously paired with an implicit `Option<WebViewId>`, even though almost all variants were either always `Some` or always `None`, depending on whether there was a `WebView involved. This patch adds the `WebViewId` to as many `EmbedderMsg` variants as possible, so we can call their associated `WebView` delegate methods without needing to check and unwrap the `Option`. In many cases, this required more changes to plumb through the `WebViewId`. Notably, all `Request`s now explicitly need a `WebView` or not, in order to ensure that it is passed when appropriate. Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Implement WebResourceRequested Event. (#34961)zhuhaichao5182025-01-162-7/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement WebResourceRequested Event on the Embedder Layer Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com> * fix and add test Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com> * resolve comments Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com> * remove sample code in webview Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com> * remove typo Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com> * ./mach format Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com> * fix test fail caused by interception message Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com> * update impl for is_for_main_frame Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com> --------- Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
* api: Flatten and simplify Servo preferences (#34966)Martin Robinson2025-01-141-2/+5
| | | | | | | | | | | | | | | | | | | Flatten and simplify Servo's preferences code. In addition, have both preferences and options passed in as arguments to `Servo::new()` and make sure not to use the globally set preferences in `servoshell` (as much as possible now). Instead of a complex procedural macro to generate preferences, just expose a very simple derive macro that adds string based getters and setters. - All command-line parsing is moved to servoshell. - There is no longer the concept of a missing preference. - Preferences no longer have to be part of the resources bundle because they now have reasonable default values. - servoshell specific preferences are no longer part of the preferences exposed by the Servo API. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* add minimal implementation of FetchParams (#34833)arthmis2025-01-124-125/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add minimal implementation of fetchParams and fetch controller for cancellation support fix something removing fetch params from http network or cache fetch due to implementation difficult Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * run formatter Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * fix incorrect spec implementation and add comments with related step number and description Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * fix double borrow issue Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * remove unused code from FetchParams Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * add workaround for double mutable borrow error Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * remove unnecessary comments, move import and format Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * fix comments that state spec instructions Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * update comment Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * refactor tests Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * refactor tests Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> --------- Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com>
* net: Use `RequestId` to cancel fetches instead of creating an IPC channel ↵Martin Robinson2025-01-112-6/+6
| | | | | | | | | | | | | | | | | | (#34883) Instead of creating an IPC channel for every fetch, allow cancelling fetches based on the `RequestId` of the original request. This requires that `RequestId`s be UUIDs so that they are unique between processes that might communicating with the resource process. In addition, the resource process loop now keeps a `HashMap` or `Weak` handles to cancellers and cleans them up. This allows for creating mutiple `FetchCanceller`s in `script` for a single fetch request, allowing integration of the media and video elements to integrate with the `Document` canceller list -- meaning these fetches also get cancelled when the `Document` unloads. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Update all network-related dependencies to the latest versions (#34630)Josh Matthews2025-01-083-693/+846
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update all network-related dependencies to the latest versions: * rustls * hyper * http * headers * tungstenite * async-tungstenite Signed-off-by: Josh Matthews <josh@joshmatthews.net> * net: Fix panics with 1xx responses in WPT tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * net: Use reported response length when calculating available ranges. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * net: Remove unreachable match arm. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * net: Clean up commented fragments in blob and file handlers. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * net: Remove unreachable match arm. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * net: Fix clippy warning. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * net: Cleanup. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * net: Fix up unit tests for dependency upgrades. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Update aws-lc-sys to fix Windows builds. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * net: Use ring instead of aws-lc-sys. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * embedding: Require embedder to initialize a rustls CryptoProvider. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Disable aws-lc-rs pending OhOS build fixes. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Prompt user for credentials when http request needs it (#34620)arthmis2024-12-283-11/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * prompt user to get their credentials Signed-off-by: Lloyd Massiah artmis9@protonmail.com move credential prompt to a function Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * add prompt for step 15.4 Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * add new prompt definition for user credentials Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * remove default implementation for HttpState which allowed making the embedder_proxy non-optional - default implementation was only used in tests so created an alternative create_http_state function Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> add credentials to authentication cache Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * add tests that are successful for the happy path Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * add test for user cancels prompt and user inputs incorrect credentials, and refactor shared code between tests Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * handle error when setting username and password in Url and ran formatting Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> renaming test functions Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * change authentication flag to false for proxy authentication. The spec doesn't specify that the flag should be true, and the flag is by default false Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * clean up test code a bit Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * add skeleton implementation to support open harmony and android Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * update warning message to include Android Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * fix build error for OH os and Android Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * remove unused import to fix warning Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> --------- Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com>
* Add prefs to limit threadpool sizes (#34478)Jonathan Schwender2024-12-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * Add prefs to limit threadpool sizes Add preferences to control the size of threadpools, so that we can easily reduce the amount of runtime threads and test which pools benefit from more threads. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Add pref for Webrender threadpool Add a preference to limit the size of the webrender threadpool. Note: WebRender by default calls hooks which register the threads with a profiler instance that the embedder can register with webrender. Servo currently doesn't register such a profiler with webrender, but in the future we might also want to profile the webrender threadpool. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* 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: Ensure that origin serialization is consistent (#34081)Martin Robinson2024-10-311-1/+23
| | | | | | | | | | | | | | A recent refactoring (#33531) made a change that resulted in the `Origin` header including the port even when the default port for a scheme was used. This made the serialization different from that used for `rust-url`'s `Origin::ascii_serialization()`, breaking CORS on some sites. This change makes it so that the serialization is consistent again. This change also fixes the visiblity on a few methods in `http_loader.rs` since visibility needs to be adjusted for testing anyway. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Use `ROUTER::add_typed_route` instead of `ROUTER::add_route` everywhere (#33866)Simon Wülker2024-10-181-3/+3
| | | | | | | | | | | | | * Use ROUTER::add_typed_route where possible Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update webxr, media and ipc-channel Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* net: Start reducing number of IPCs channels used for fetch with a ↵Martin Robinson2024-10-165-245/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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-162-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix handling of `__Secure-` and `__Host-` Cookie prefixes (#33717)Simon Wülker2024-10-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make checking for cookie prefixes case-insensitive Cookie-Prefixes like "__Host-" and "__Secure-" are case insensitive as per https://www.ietf.org/archive/id/draft-ietf-httpbis-rfc6265bis-15.html#name-storage-model. This is tested by many WPT tests in cookies/prefix, for example * cookies/prefix/__host.document-cookie.html * cookies/prefix/__host.document-cookie.https.html Since the implementation and the specification had diverged quite significantly i also updated/added spec comments where appropriate and slightly restructured code so its easier to follow. However, the only change in behaviour is the prefix check described above. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Remove unused import Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix cookie test cases Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix ignore cookie with __Host prefix and no specified path attribute Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix another cookie test case Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* net: Refactor `Decoder` (#33611)Cristian Brinza2024-10-021-7/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor Decoder to be fully async Signed-off-by: crbrz <cristianb@gmail.com> * Update WPT results Signed-off-by: crbrz <cristianb@gmail.com> * Fix deflate unit test Signed-off-by: crbrz <cristianb@gmail.com> * Add compressed response update count test Signed-off-by: crbrz <cristianb@gmail.com> * Fix typo Signed-off-by: crbrz <cristianb@gmail.com> * Source error check without conversion to String Signed-off-by: crbrz <cristianb@gmail.com> * Simplify error check Signed-off-by: crbrz <cristianb@gmail.com> * Fix variable name Signed-off-by: crbrz <cristianb@gmail.com> * Added TODO note for network.tls.ignore_unexpected_eof Signed-off-by: crbrz <cristianb@gmail.com> --------- Signed-off-by: crbrz <cristianb@gmail.com>
* Create HttpStatus to safely deal with HTTP responses status. (#33581)webbeef2024-09-293-62/+36
| | | Signed-off-by: webbeef <me@webbeef.org>
* Stop using `time@0.1` in Servo (#33394)Martin Robinson2024-09-111-8/+11
| | | | | | | | This removes the last few uses of `time@0.1` in Servo. There are still dependencies from `style` and `webrender`, but they will be removed soon as well. The uses of this version of `time` are replaced with `std::time` types and `time@0.3` when negative `Duration` is necessary. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Make all platforms use a delay during cookie tests. (#33279)Josh Matthews2024-09-011-4/+0
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* make protocol handlers registrable (#33104)webbeef2024-08-223-0/+8
| | | Signed-off-by: webbeef <me@webbeef.org>
* Replace the lazy_static crate with std::sync::LazyLock in components/net ↵Hayashi Mikihiro2024-08-141-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | (#33046) * replace in net/fetch/methods.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in net/hosts.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in net/async_runtime.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in net/tests/main.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * remove lazy_static crate from components/net Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> --------- Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* Update to rust 1.80.0 (#32896)Hayashi Mikihiro2024-08-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update for nix Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Update to Rust 1.80.0 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Rename to BindingMode from BindingAnnotation https://github.com/rust-lang/rust/pull/124047 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Remove TypeVariableOriginKind https://github.com/rust-lang/rust/pull/123016 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Remove TypeVariableOrigin https://github.com/rust-lang/rust/pull/124955 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Remove LintDiagnostic::msg rust-lang/rust#125410 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * common.rs fmt mistake indents Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * trace_in_no_trace.rs remove mistake space Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * trace_in_no_trace.rs remove mistake head space Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Workaround for https://github.com/servo/servo/issues/32912 It's dirty but it worked on 2000 runs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
* dependencies: Upgrade `cookie` and rename Servo's `Cookie` to `ServoCookie` ↵Martin Robinson2024-07-263-115/+114
| | | | | | | | | | | | | | (#32861) This changes updates to the new version of the `cookie` crate in Servo which no longer uses the old `time@0.1` data types. This requires using a new version of `time` while we transition off of the old one. This is the first step in that process. In addition, the overloading of the `cookie::Cookie` name was causing a great deal of confusion, so I've renamed the Servo wrapper to `ServoCookie` like we do with `ServoUrl`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* DevTools: Replace camel case variable names (#32726)eri2024-07-082-4/+4
| | | | | | | | | * 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-173-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 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-162-11/+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-112-19/+26
| | | | | - 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-104-8/+8
| | | | | | | * clippy: fix some warnings in components/net * fix: review comments * fix: tidy
* Revert "Replace time with std::time in components/net (#31079)" (#31120)Martin Robinson2024-01-181-26/+8
| | | This reverts commit 580062228bb083ccdc2144a43491bc4f916c57ad.
* Replace time with std::time in components/net (#31079)Taym Haddadi2024-01-171-8/+26
| | | | | | | | | | | | | * Replace time with std::time in components/net Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Fix cookie::test_sort_order test Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-1110-58/+67
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-3/+1
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Switch to rustls and webpki-roots (#30025)Martin Robinson2023-08-083-102/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-165-93/+114
|
* Non-blocking network IONaveen Gattu2021-12-233-14/+32
|
* Fix tidy error.Josh Matthews2021-05-281-1/+0
|
* Disable warnings on windows.Josh Matthews2021-05-281-0/+2
|
* Disable fetch tests on windows.Josh Matthews2021-05-271-2/+1
|
* Don't error on unused imports.Josh Matthews2021-05-271-0/+2
|