Bug 1860379 [wpt PR 42675] - Fix handling invalid date for Expires header value "0" as expired, a=testonly

Automatic update from web-platform-tests
Fix handling invalid date for Expires header value "0" as expired

This CL changes handling the invalid Expires header value "0" as a time in the
past and stale, as described in section 5.3 [1] of RFC 9111.

> A cache recipient MUST interpret invalid date formats, especially the value
> "0", as representing a time in the past (i.e., "already expired").

[1] https://www.rfc-editor.org/rfc/rfc9111.html#section-5.3

Bug: 853508
Change-Id: I853b2972c4420936fda8373e292d2d90fdb7988a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4021895
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1232768}

--

wpt-commits: e8d57f52b64b733a0927503ed31b8e4e9c7100a7
wpt-pr: 42675
This commit is contained in:
Ryo Ogawa 2023-12-13 00:58:48 +00:00 коммит произвёл moz-wptsync-bot
Родитель ffdcab51eb
Коммит be08e82b8f
1 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -59,6 +59,34 @@ var tests = [
}
]
},
{
name: "HTTP cache does not reuse a response with an invalid Expires with Last-Modified now",
requests: [
{
response_headers: [
["Expires", "0"],
['Last-Modified', 0]
]
},
{
expected_type: "not_cached"
}
]
},
{
name: "HTTP cache does not reuse a response with an invalid Expires with past Last-Modified",
requests: [
{
response_headers: [
["Expires", "0"],
['Last-Modified', -100000]
]
},
{
expected_type: "not_cached"
}
]
},
{
name: "HTTP cache reuses a response with positive Cache-Control: max-age",
requests: [