1
0
Fork 0
firefox/testing/web-platform/tests/fetch/http-cache/post-patch.any.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

46 lines
1.2 KiB
JavaScript

// META: global=window,worker
// META: title=HTTP Cache - Caching POST and PATCH responses
// META: timeout=long
// META: script=/common/utils.js
// META: script=/common/get-host-info.sub.js
// META: script=http-cache.js
var tests = [
{
name: "HTTP cache uses content after PATCH request with response containing Content-Location and cache-allowing header",
requests: [
{
request_method: "PATCH",
request_body: "abc",
response_status: [200, "OK"],
response_headers: [
['Cache-Control', "private, max-age=1000"],
['Content-Location', ""]
],
response_body: "abc"
},
{
expected_type: "cached"
}
]
},
{
name: "HTTP cache uses content after POST request with response containing Content-Location and cache-allowing header",
requests: [
{
request_method: "POST",
request_body: "abc",
response_status: [200, "OK"],
response_headers: [
['Cache-Control', "private, max-age=1000"],
['Content-Location', ""]
],
response_body: "abc"
},
{
expected_type: "cached"
}
]
}
];
run_tests(tests);