net: Add spec comments to "cors_preflight_fetch" (#39246)

I added these comments while debugging `cors/request-headers.htm`.
Ultimately the bug turned out to be outside of servo, so we have to wait
for https://github.com/hyperium/headers/pull/219.
Since that PR might take a while to merge I'd like to add these on their
own.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-09-11 03:31:51 +02:00 committed by GitHub
parent 93ad2cf62a
commit 3b294d0856
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 55 additions and 31 deletions

View file

@ -878,8 +878,8 @@ fn validate_range_header(value: &str) -> bool {
}
/// <https://fetch.spec.whatwg.org/#cors-safelisted-method>
pub fn is_cors_safelisted_method(m: &Method) -> bool {
matches!(*m, Method::GET | Method::HEAD | Method::POST)
pub fn is_cors_safelisted_method(method: &Method) -> bool {
matches!(*method, Method::GET | Method::HEAD | Method::POST)
}
/// <https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name>