mirror of
https://github.com/servo/servo.git
synced 2025-09-10 15:08:21 +01:00
net: Ignore pragma: no-cache
if cache-control is understood (#38946)
This PR fixes a failed WPT: https://wpt.fyi/results/fetch/http-cache/pragma-no-cache-with-cache-control.html?product=servo [As RFC9111 mentions,](https://www.rfc-editor.org/rfc/rfc9111.html#section-5.4) the Pragma header field is deprecated. And, in WPT, it expects the Pragma header field is ignored if a cache-control header field is specified and understood by UA. Testing: running `./mach test-wpt fetch/http-cache/pragma-no-cache-with-cache-control.html` --------- Signed-off-by: araya <araya@araya.dev>
This commit is contained in:
parent
33e934421e
commit
ebaf78116a
2 changed files with 2 additions and 4 deletions
|
@ -146,7 +146,8 @@ fn response_is_cacheable(metadata: &Metadata) -> bool {
|
||||||
directive.max_age().is_some() ||
|
directive.max_age().is_some() ||
|
||||||
directive.no_cache()
|
directive.no_cache()
|
||||||
{
|
{
|
||||||
is_cacheable = true;
|
// If cache-control is understood, we can use it and ignore pragma.
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(pragma) = headers.typed_get::<Pragma>() {
|
if let Some(pragma) = headers.typed_get::<Pragma>() {
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[pragma-no-cache-with-cache-control.html]
|
|
||||||
[Response with Cache-Control: max-age=2592000, public and Pragma: no-cache should be cached]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue