servo/components/net
Simon Wülker ff6523c37e
Fix handling of __Secure- and __Host- Cookie prefixes (#33717)
* 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>
2024-10-09 04:52:48 +00:00
..
fetch Create HttpStatus to safely deal with HTTP responses status. (#33581) 2024-09-29 18:23:48 +00:00
protocols Create HttpStatus to safely deal with HTTP responses status. (#33581) 2024-09-29 18:23:48 +00:00
tests Fix handling of __Secure- and __Host- Cookie prefixes (#33717) 2024-10-09 04:52:48 +00:00
async_runtime.rs Replace the lazy_static crate with std::sync::LazyLock in components/net (#33046) 2024-08-14 12:15:55 +00:00
Cargo.toml net: Refactor Decoder (#33611) 2024-10-02 16:59:31 +00:00
connector.rs Net: fold websocket and http tokio runtime into one (#31771) 2024-03-21 06:13:03 +00:00
cookie.rs Fix handling of __Secure- and __Host- Cookie prefixes (#33717) 2024-10-09 04:52:48 +00:00
cookie_storage.rs net: Stop using both versions of the time crate in the cookie code (#33260) 2024-08-30 17:15:47 +00:00
decoder.rs net: Refactor Decoder (#33611) 2024-10-02 16:59:31 +00:00
filemanager_thread.rs Stop using time@0.1 in Servo (#33394) 2024-09-11 07:09:56 +00:00
hosts.rs Replace the lazy_static crate with std::sync::LazyLock in components/net (#33046) 2024-08-14 12:15:55 +00:00
hsts.rs Replace .map_or(false with Option::is_some_and (#33468) 2024-09-16 10:03:52 +00:00
http_cache.rs Create HttpStatus to safely deal with HTTP responses status. (#33581) 2024-09-29 18:23:48 +00:00
http_loader.rs Bring http_network_or_cache_fetch closer to the spec (#33531) 2024-10-08 05:36:46 +00:00
image_cache.rs Revert "compositor: Create a single cross-process compositor API (#33619)" (#33645) 2024-10-04 09:08:19 +00:00
lib.rs net: Refactor Decoder (#33611) 2024-10-02 16:59:31 +00:00
local_directory_listing.rs clippy: Fix a bunch of warnings in script (#32680) 2024-07-04 11:40:23 +00:00
mime_classifier.rs clippy: Fix a bunch of warnings in script (#32680) 2024-07-04 11:40:23 +00:00
resource_thread.rs make protocol handlers registrable (#33104) 2024-08-22 04:11:16 +00:00
storage_thread.rs Replace .map_or(false with Option::is_some_and (#33468) 2024-09-16 10:03:52 +00:00
subresource_integrity.rs clippy: Fix warnings in components/net (#31626) 2024-03-13 09:40:04 +00:00
websocket_loader.rs dependencies: Upgrade cookie and rename Servo's Cookie to ServoCookie (#32861) 2024-07-26 16:13:39 +00:00