diff --git a/.github/workflows/update-cache-tests.yml b/.github/workflows/update-cache-tests.yml deleted file mode 100644 index a1696737919..00000000000 --- a/.github/workflows/update-cache-tests.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Update Cache Tests - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - -permissions: - contents: write - pull-requests: write - -jobs: - update-cache-tests: - name: Update Cache Tests - runs-on: ubuntu-latest - steps: - - name: Git Config - run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - - - name: Checkout Repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: true - - - name: Update Cache Tests - run: | - rm -rf test/fixtures/cache-tests && mkdir test/fixtures/cache-tests && - - git clone https://github.com/http-tests/cache-tests --depth=1 test/fixtures/tmp-cache-tests/ && - - mv test/fixtures/tmp-cache-tests/LICENSE test/fixtures/cache-tests/LICENSE && - mv test/fixtures/tmp-cache-tests/tests test/fixtures/cache-tests/tests && - mv test/fixtures/tmp-cache-tests/test-engine test/fixtures/cache-tests/test-engine && - mv test/fixtures/tmp-cache-tests/results test/fixtures/cache-tests/results && - - rm -rf test/fixtures/tmp-cache-tests/ - - - name: Create Pull Request - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 - with: - base: main - branch: cache-tests-update - title: Update Cache Tests - body: Automated update of the Cache Test Suite - commit-message: "chore: update cache tests" diff --git a/.github/workflows/update-wpt.yml b/.github/workflows/update-submodules.yml similarity index 73% rename from .github/workflows/update-wpt.yml rename to .github/workflows/update-submodules.yml index 715004d49d6..4eb29f4ac42 100644 --- a/.github/workflows/update-wpt.yml +++ b/.github/workflows/update-submodules.yml @@ -1,4 +1,4 @@ -name: Update WPT +name: Update Submodules on: workflow_dispatch: @@ -11,7 +11,7 @@ permissions: jobs: update-wpt: - name: Update WPT + name: Update Submodules runs-on: ubuntu-latest steps: - name: Git Config @@ -26,7 +26,7 @@ jobs: uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 with: base: main - branch: wpt-update - title: Update WPT - body: Automated update of the WPT - commit-message: "chore: update WPT" + branch: submodules-update + title: Update Submodules + body: Automated update of the Submodules + commit-message: "chore: update Submodules" diff --git a/.gitmodules b/.gitmodules index 1228eec123e..ff6357afd2e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "test/web-platform-tests/wpt"] path = test/web-platform-tests/wpt url = https://github.com/web-platform-tests/wpt.git +[submodule "test/fixtures/cache-tests"] + path = test/fixtures/cache-tests + url = https://github.com/http-tests/cache-tests diff --git a/test/fixtures/cache-tests b/test/fixtures/cache-tests new file mode 160000 index 00000000000..1000acb7071 --- /dev/null +++ b/test/fixtures/cache-tests @@ -0,0 +1 @@ +Subproject commit 1000acb7071ed401a654160f13d27c2a8a0139cc diff --git a/test/fixtures/cache-tests/LICENSE b/test/fixtures/cache-tests/LICENSE deleted file mode 100644 index f377bbc9118..00000000000 --- a/test/fixtures/cache-tests/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2018, Mark Nottingham -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/fixtures/cache-tests/results/apache.json b/test/fixtures/cache-tests/results/apache.json deleted file mode 100644 index 7d189996e59..00000000000 --- a/test/fixtures/cache-tests/results/apache.json +++ /dev/null @@ -1,691 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": true, - "304-etag-update-response-Clear-Site-Data": true, - "304-etag-update-response-Content-Encoding": [ - "Setup", - "retry" - ], - "304-etag-update-response-Content-Foo": true, - "304-etag-update-response-Content-Length": [ - "Setup", - "retry" - ], - "304-etag-update-response-Content-Location": [ - "Setup", - "retry" - ], - "304-etag-update-response-Content-MD5": [ - "Setup", - "retry" - ], - "304-etag-update-response-Content-Range": [ - "Setup", - "retry" - ], - "304-etag-update-response-Content-Security-Policy": true, - "304-etag-update-response-Content-Type": [ - "Setup", - "retry" - ], - "304-etag-update-response-ETag": [ - "Setup", - "retry" - ], - "304-etag-update-response-Expires": true, - "304-etag-update-response-Public-Key-Pins": true, - "304-etag-update-response-Set-Cookie": true, - "304-etag-update-response-Set-Cookie2": true, - "304-etag-update-response-Test-Header": true, - "304-etag-update-response-X-Content-Foo": true, - "304-etag-update-response-X-Frame-Options": true, - "304-etag-update-response-X-Test-Header": true, - "304-etag-update-response-X-XSS-Protection": true, - "304-lm-use-stored-Test-Header": true, - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": true, - "age-parse-large": true, - "age-parse-large-minus-one": true, - "age-parse-larger": true, - "age-parse-negative": true, - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-suffix-twoline": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": true, - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": true, - "cc-resp-no-cache-revalidate-fresh": true, - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-shared": true, - "ccreq-ma0": true, - "ccreq-ma1": true, - "ccreq-magreaterage": true, - "ccreq-max-stale": true, - "ccreq-max-stale-age": true, - "ccreq-min-fresh": true, - "ccreq-min-fresh-age": true, - "ccreq-no-cache": true, - "ccreq-no-cache-etag": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "ccreq-no-cache-lm": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "ccreq-no-store": true, - "ccreq-oic": true, - "cdn-cc-invalid-sh-type-unknown": true, - "cdn-cc-invalid-sh-type-wrong": true, - "cdn-date-update-exceed": true, - "cdn-expires-update-exceed": [ - "Assertion", - "Response 2 header Expires is \"null\", not \"Sat, 24 May 2025 02:02:37 GMT\"" - ], - "cdn-fresh-cc-nostore": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-0": true, - "cdn-max-age-0-expires": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-age": true, - "cdn-max-age-case-insensitive": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-cc-max-age-invalid-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-extension": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-long-cc-max-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-max": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-max-plus": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-short-cc-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-space-after-equals": true, - "cdn-max-age-space-before-equals": true, - "cdn-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-no-store-cc-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-private": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-remove-age-exceed": [ - "Assertion", - "Response 2 Age header not present." - ], - "cdn-remove-header": true, - "conditional-304-etag": true, - "conditional-etag-forward": true, - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-precedence": true, - "conditional-etag-quoted-respond-unquoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-strong-generate": true, - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-strong-respond": true, - "conditional-etag-strong-respond-multiple-first": true, - "conditional-etag-strong-respond-multiple-last": true, - "conditional-etag-strong-respond-multiple-second": true, - "conditional-etag-strong-respond-obs-text": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-unquoted-respond-quoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-unquoted-respond-unquoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-vary-headers": true, - "conditional-etag-vary-headers-mismatch": true, - "conditional-etag-weak-generate-weak": true, - "conditional-etag-weak-respond": true, - "conditional-etag-weak-respond-backslash": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-weak-respond-lowercase": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-weak-respond-omit-slash": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-lm-fresh": true, - "conditional-lm-fresh-earlier": true, - "conditional-lm-fresh-no-lm": [ - "Setup", - "Response 2 does not come from cache" - ], - "conditional-lm-fresh-rfc850": true, - "conditional-lm-stale": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": true, - "freshness-expires-age-slow-date": true, - "freshness-expires-ansi-c": true, - "freshness-expires-far-future": true, - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": true, - "freshness-expires-invalid-2-digit-year": true, - "freshness-expires-invalid-aest": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": true, - "freshness-expires-invalid-multiple-lines": true, - "freshness-expires-invalid-multiple-spaces": true, - "freshness-expires-invalid-no-comma": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-time-periods": true, - "freshness-expires-invalid-utc": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-old-date": true, - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": true, - "freshness-expires-wrong-case-month": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-tz": true, - "freshness-expires-wrong-case-weekday": true, - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": true, - "freshness-max-age-decimal-five": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-decimal-zero": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-s-maxage-shared-longer": true, - "freshness-max-age-s-maxage-shared-longer-multiple": true, - "freshness-max-age-s-maxage-shared-longer-reversed": true, - "freshness-max-age-s-maxage-shared-shorter": true, - "freshness-max-age-s-maxage-shared-shorter-expires": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": true, - "freshness-max-age-space-before-equals": true, - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-fresh-stale-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sameline": true, - "freshness-max-age-two-stale-fresh-sepline": true, - "freshness-none": true, - "freshness-s-maxage-shared": true, - "head-200-freshness-update": [ - "Assertion", - "Response 3 does not come from cache" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-410-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-writethrough": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": true, - "headers-omit-headers-listed-in-Connection": true, - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": true, - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": true, - "headers-store-Set-Cookie2": true, - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": true, - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": true, - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": true, - "heuristic-204-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Setup", - "Response 2 status is 500, not 599" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": true, - "heuristic-delta-1800": true, - "heuristic-delta-30": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-300": true, - "heuristic-delta-3600": true, - "heuristic-delta-43200": true, - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": true, - "heuristic-delta-600": true, - "heuristic-delta-86400": true, - "interim-102": true, - "interim-103": true, - "interim-no-header-reuse": true, - "interim-not-cached": true, - "invalidate-DELETE": true, - "invalidate-DELETE-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-failed": true, - "invalidate-DELETE-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-failed": true, - "invalidate-M-SEARCH-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST": true, - "invalidate-POST-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-failed": true, - "invalidate-POST-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT": true, - "invalidate-PUT-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-failed": true, - "invalidate-PUT-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 age header not present." - ], - "other-age-gen": true, - "other-age-update-expires": true, - "other-age-update-max-age": true, - "other-authorization": true, - "other-authorization-must-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-authorization-public": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-authorization-smaxage": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-cookie": true, - "other-date-update": [ - "Assertion", - "Response 2 header Date is \"Sat, 24 May 2025 02:02:31 GMT\", not \"Sat, 24 May 2025 02:02:28 GMT\"" - ], - "other-date-update-expires": [ - "Assertion", - "Response 2 header Date is \"Sat, 24 May 2025 02:02:31 GMT\", not \"Sat, 24 May 2025 02:02:28 GMT\"" - ], - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": true, - "other-set-cookie": true, - "partial-store-complete-reuse-partial": true, - "partial-store-complete-reuse-partial-no-last": true, - "partial-store-complete-reuse-partial-suffix": true, - "partial-store-partial-complete": [ - "Assertion", - "Request 2 header range is \"undefined\", not \"bytes=5-\"" - ], - "partial-store-partial-reuse-partial": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-use-headers": true, - "partial-use-stored-headers": true, - "pragma-request-extension": true, - "pragma-request-no-cache": [ - "Assertion", - "Response 2 does not come from cache" - ], - "pragma-response-extension": true, - "pragma-response-no-cache": [ - "Assertion", - "Response 2 does not come from cache" - ], - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": true, - "stale-close": [ - "TypeError", - "fetch failed" - ], - "stale-close-must-revalidate": [ - "TypeError", - "fetch failed" - ], - "stale-close-no-cache": [ - "TypeError", - "fetch failed" - ], - "stale-close-proxy-revalidate": true, - "stale-close-s-maxage=2": [ - "TypeError", - "fetch failed" - ], - "stale-sie-503": [ - "TypeError", - "fetch failed" - ], - "stale-sie-close": [ - "TypeError", - "fetch failed" - ], - "stale-warning-become": [ - "TypeError", - "fetch failed" - ], - "stale-warning-stored": [ - "TypeError", - "fetch failed" - ], - "stale-while-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-while-revalidate-window": [ - "Setup", - "Response 2 does not come from cache" - ], - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-204-stale": true, - "status-299-fresh": [ - "Setup", - "Response 2 status is 500, not 299" - ], - "status-299-stale": true, - "status-301-fresh": true, - "status-301-stale": true, - "status-302-fresh": true, - "status-302-stale": true, - "status-303-fresh": true, - "status-303-stale": true, - "status-307-fresh": true, - "status-307-stale": true, - "status-308-fresh": true, - "status-308-stale": true, - "status-400-fresh": true, - "status-400-stale": true, - "status-404-fresh": true, - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": [ - "Setup", - "Response 2 status is 500, not 499" - ], - "status-499-stale": true, - "status-500-fresh": true, - "status-500-stale": true, - "status-502-fresh": true, - "status-502-stale": true, - "status-503-fresh": true, - "status-503-stale": true, - "status-504-fresh": true, - "status-504-stale": true, - "status-599-fresh": [ - "Setup", - "Response 2 status is 500, not 599" - ], - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": true, - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": true, - "vary-syntax-empty-star-lines": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-foo-star": true, - "vary-syntax-star": true, - "vary-syntax-star-foo": true, - "vary-syntax-star-star": true, - "vary-syntax-star-star-lines": true -} diff --git a/test/fixtures/cache-tests/results/caddy.json b/test/fixtures/cache-tests/results/caddy.json deleted file mode 100644 index 75c89cc7597..00000000000 --- a/test/fixtures/cache-tests/results/caddy.json +++ /dev/null @@ -1,832 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Clear-Site-Data": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Encoding": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Foo": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Length": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Location": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-MD5": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Range": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Security-Policy": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Type": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-ETag": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Expires": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Public-Key-Pins": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Set-Cookie": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Set-Cookie2": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Test-Header": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-X-Content-Foo": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-X-Frame-Options": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-X-Test-Header": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-X-XSS-Protection": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-lm-use-stored-Test-Header": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": true, - "age-parse-large": true, - "age-parse-large-minus-one": true, - "age-parse-larger": true, - "age-parse-negative": true, - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-suffix-twoline": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": [ - "Assertion", - "Request 3 should have been conditional, but it was not." - ], - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "cc-resp-no-cache-revalidate-fresh": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-shared": true, - "ccreq-ma0": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-ma1": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-magreaterage": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-max-stale": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-max-stale-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-min-fresh": true, - "ccreq-min-fresh-age": true, - "ccreq-no-cache": true, - "ccreq-no-cache-etag": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "ccreq-no-cache-lm": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "ccreq-no-store": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-oic": [ - "Assertion", - "Response 1 status is 200, not 504" - ], - "cdn-cc-invalid-sh-type-unknown": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-cc-invalid-sh-type-wrong": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-date-update-exceed": true, - "cdn-expires-update-exceed": [ - "Assertion", - "Response 2 header Expires is \"null\", not \"Sat, 24 May 2025 02:05:19 GMT\"" - ], - "cdn-fresh-cc-nostore": true, - "cdn-max-age": true, - "cdn-max-age-0": true, - "cdn-max-age-0-expires": true, - "cdn-max-age-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-case-insensitive": true, - "cdn-max-age-cc-max-age-invalid-expires": true, - "cdn-max-age-expires": true, - "cdn-max-age-extension": true, - "cdn-max-age-long-cc-max-age": true, - "cdn-max-age-max": true, - "cdn-max-age-max-plus": true, - "cdn-max-age-short-cc-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-space-after-equals": true, - "cdn-max-age-space-before-equals": true, - "cdn-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-no-store-cc-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-private": true, - "cdn-remove-age-exceed": [ - "Assertion", - "Response 2 Age header not present." - ], - "cdn-remove-header": true, - "conditional-304-etag": true, - "conditional-etag-forward": true, - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-precedence": true, - "conditional-etag-quoted-respond-unquoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-strong-generate": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "conditional-etag-strong-respond": true, - "conditional-etag-strong-respond-multiple-first": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-strong-respond-multiple-last": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-strong-respond-multiple-second": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-strong-respond-obs-text": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-unquoted-respond-quoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-etag-unquoted-respond-unquoted": true, - "conditional-etag-vary-headers": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "conditional-etag-vary-headers-mismatch": true, - "conditional-etag-weak-generate-weak": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "conditional-etag-weak-respond": true, - "conditional-etag-weak-respond-backslash": true, - "conditional-etag-weak-respond-lowercase": true, - "conditional-etag-weak-respond-omit-slash": true, - "conditional-lm-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-lm-fresh-earlier": [ - "Assertion", - "Response 2 does not come from cache" - ], - "conditional-lm-fresh-no-lm": [ - "Setup", - "Response 2 does not come from cache" - ], - "conditional-lm-fresh-rfc850": [ - "Setup", - "Response 2 does not come from cache" - ], - "conditional-lm-stale": true, - "freshness-expires-32bit": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-age-fast-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-age-slow-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-ansi-c": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-far-future": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": true, - "freshness-expires-invalid-2-digit-year": true, - "freshness-expires-invalid-aest": true, - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": true, - "freshness-expires-invalid-multiple-lines": true, - "freshness-expires-invalid-multiple-spaces": true, - "freshness-expires-invalid-no-comma": true, - "freshness-expires-invalid-time-periods": true, - "freshness-expires-invalid-utc": true, - "freshness-expires-old-date": true, - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-month": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-tz": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-weekday": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": true, - "freshness-max-age-decimal-five": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-decimal-zero": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": true, - "freshness-max-age-s-maxage-shared-longer": true, - "freshness-max-age-s-maxage-shared-longer-multiple": true, - "freshness-max-age-s-maxage-shared-longer-reversed": true, - "freshness-max-age-s-maxage-shared-shorter": true, - "freshness-max-age-s-maxage-shared-shorter-expires": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": true, - "freshness-max-age-space-before-equals": true, - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-fresh-stale-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sameline": true, - "freshness-max-age-two-stale-fresh-sepline": true, - "freshness-none": true, - "freshness-s-maxage-shared": true, - "head-200-freshness-update": [ - "Assertion", - "Response 3 does not come from cache" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-410-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-writethrough": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Connection": true, - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": true, - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": true, - "headers-store-Set-Cookie2": true, - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": [ - "Setup", - "Response 1 status is 502, not 200" - ], - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-204-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1800": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-30": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-300": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-3600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-43200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-86400": [ - "Assertion", - "Response 2 does not come from cache" - ], - "interim-102": [ - "Assertion", - "Interim response 1 not received" - ], - "interim-103": [ - "Assertion", - "Interim response 1 not received" - ], - "interim-no-header-reuse": [ - "Assertion", - "Interim response 1 not received" - ], - "interim-not-cached": [ - "Assertion", - "Interim response 1 not received" - ], - "invalidate-DELETE": true, - "invalidate-DELETE-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-failed": true, - "invalidate-DELETE-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH": true, - "invalidate-M-SEARCH-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-failed": true, - "invalidate-M-SEARCH-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST": true, - "invalidate-POST-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-failed": true, - "invalidate-POST-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT": true, - "invalidate-PUT-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-failed": true, - "invalidate-PUT-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 age header not present." - ], - "other-age-gen": true, - "other-age-update-expires": true, - "other-age-update-max-age": true, - "other-authorization": true, - "other-authorization-must-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-authorization-public": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-authorization-smaxage": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-cookie": true, - "other-date-update": true, - "other-date-update-expires": true, - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-set-cookie": true, - "partial-store-complete-reuse-partial": [ - "Assertion", - "Response 2 status is 200, not 206" - ], - "partial-store-complete-reuse-partial-no-last": [ - "Assertion", - "Response 2 status is 200, not 206" - ], - "partial-store-complete-reuse-partial-suffix": [ - "Assertion", - "Response 2 status is 200, not 206" - ], - "partial-store-partial-complete": [ - "Setup", - "Response 2 status is 206, not 200" - ], - "partial-store-partial-reuse-partial": true, - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response body is \"01234\", not \"234\"" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response body is \"01234\", not \"234\"" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response body is \"01234\", not \"4\"" - ], - "partial-use-headers": [ - "Setup", - "Response 2 status is 200, not 206" - ], - "partial-use-stored-headers": [ - "Setup", - "Response 2 status is 200, not 206" - ], - "pragma-request-extension": true, - "pragma-request-no-cache": true, - "pragma-response-extension": true, - "pragma-response-no-cache": true, - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close-must-revalidate": true, - "stale-close-no-cache": true, - "stale-close-proxy-revalidate": true, - "stale-close-s-maxage=2": true, - "stale-sie-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-sie-close": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-warning-become": [ - "Setup", - "Response 2 does not come from cache" - ], - "stale-warning-stored": [ - "Setup", - "Response 2 does not come from cache" - ], - "stale-while-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-while-revalidate-window": [ - "Setup", - "Response 2 does not come from cache" - ], - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": true, - "status-204-stale": true, - "status-299-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-299-stale": true, - "status-301-fresh": true, - "status-301-stale": true, - "status-302-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-302-stale": true, - "status-303-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-303-stale": true, - "status-307-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-307-stale": true, - "status-308-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-308-stale": true, - "status-400-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-400-stale": true, - "status-404-fresh": true, - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-499-stale": true, - "status-500-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-500-stale": true, - "status-502-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-502-stale": true, - "status-503-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-503-stale": true, - "status-504-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-504-stale": true, - "status-599-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": true, - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": true, - "vary-syntax-empty-star-lines": true, - "vary-syntax-foo-star": true, - "vary-syntax-star": true, - "vary-syntax-star-foo": true, - "vary-syntax-star-star": true, - "vary-syntax-star-star-lines": true -} diff --git a/test/fixtures/cache-tests/results/chrome.json b/test/fixtures/cache-tests/results/chrome.json deleted file mode 100644 index f243e299015..00000000000 --- a/test/fixtures/cache-tests/results/chrome.json +++ /dev/null @@ -1,599 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": true, - "304-etag-update-response-Clear-Site-Data": [ - "Assertion", - "Response 2 header Clear-Site-Data is \"null\", not \"cookies\"" - ], - "304-etag-update-response-Content-Encoding": [ - "Assertion", - "Response 2 header Content-Encoding is \"arizqhypgxofwne\", not \"askcumewogyqias\"" - ], - "304-etag-update-response-Content-Foo": true, - "304-etag-update-response-Content-Length": true, - "304-etag-update-response-Content-Location": [ - "Assertion", - "Response 2 header Content-Location is \"/foo\", not \"/bar\"" - ], - "304-etag-update-response-Content-MD5": [ - "Assertion", - "Response 2 header Content-MD5 is \"rL0Y20zC+Fzt72VPzMSk2A==\", not \"N7UdGUp1E+RbVvZSTy1R8g==\"" - ], - "304-etag-update-response-Content-Range": [ - "Assertion", - "Response 2 header Content-Range is \"apetixmbqfujync\", not \"aqgwmcsiyoeukaq\"" - ], - "304-etag-update-response-Content-Security-Policy": true, - "304-etag-update-response-Content-Type": [ - "Assertion", - "Response 2 header Content-Type is \"text/plain\", not \"text/plain;charset=utf-8\"" - ], - "304-etag-update-response-ETag": [ - "Assertion", - "Response 2 header ETag is \"\"abcdef\"\", not \"\"ghijkl\"\"" - ], - "304-etag-update-response-Expires": true, - "304-etag-update-response-Public-Key-Pins": true, - "304-etag-update-response-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "304-etag-update-response-Set-Cookie2": [ - "Assertion", - "Response 2 header Set-Cookie2 is \"null\", not \"a=c\"" - ], - "304-etag-update-response-Test-Header": true, - "304-etag-update-response-X-Content-Foo": [ - "Assertion", - "Response 2 header X-Content-Foo is \"azyxwvutsrqponm\", not \"aaaaaaaaaaaaaaa\"" - ], - "304-etag-update-response-X-Frame-Options": [ - "Assertion", - "Response 2 header X-Frame-Options is \"deny\", not \"sameorigin\"" - ], - "304-etag-update-response-X-Test-Header": true, - "304-etag-update-response-X-XSS-Protection": [ - "Assertion", - "Response 2 header X-XSS-Protection is \"1\", not \"1; mode=block\"" - ], - "304-lm-use-stored-Test-Header": true, - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": true, - "age-parse-large": true, - "age-parse-large-minus-one": true, - "age-parse-larger": true, - "age-parse-negative": true, - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": true, - "age-parse-suffix-twoline": true, - "cc-resp-immutable-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cc-resp-immutable-stale": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": true, - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": true, - "cc-resp-no-cache-revalidate-fresh": true, - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-private": true, - "ccreq-ma0": true, - "ccreq-ma1": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-magreaterage": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-max-stale": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-max-stale-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-min-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-min-fresh-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-no-cache": true, - "ccreq-no-cache-etag": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "ccreq-no-cache-lm": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "ccreq-no-store": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-oic": [ - "Assertion", - "Response 1 status is 200, not 504" - ], - "conditional-etag-forward": true, - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-strong-generate": true, - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-vary-headers": true, - "conditional-etag-vary-headers-mismatch": [ - "Assertion", - "Request 2 header If-None-Match is \"\"abcdef\"\"" - ], - "conditional-etag-weak-generate-weak": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": true, - "freshness-expires-age-slow-date": true, - "freshness-expires-ansi-c": true, - "freshness-expires-far-future": true, - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-2-digit-year": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-aest": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-multiple-lines": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-multiple-spaces": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-no-comma": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-time-periods": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-utc": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-old-date": true, - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": true, - "freshness-expires-wrong-case-month": true, - "freshness-expires-wrong-case-tz": true, - "freshness-expires-wrong-case-weekday": true, - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": true, - "freshness-max-age-decimal-five": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-decimal-zero": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-s-maxage-private": true, - "freshness-max-age-s-maxage-private-multiple": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-space-before-equals": true, - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": true, - "freshness-max-age-two-fresh-stale-sepline": true, - "freshness-max-age-two-stale-fresh-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-none": true, - "head-200-freshness-update": [ - "Assertion", - "Response 3 does not come from cache" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-410-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-writethrough": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": true, - "headers-omit-headers-listed-in-Connection": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": [ - "Assertion", - "Response 2 header Clear-Site-Data is \"null\", not \"cookies\"" - ], - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": true, - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "headers-store-Set-Cookie2": [ - "Assertion", - "Response 2 header Set-Cookie2 is \"null\", not \"a=c\"" - ], - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": true, - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": true, - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": true, - "heuristic-204-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": true, - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": true, - "heuristic-delta-1800": true, - "heuristic-delta-30": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-300": true, - "heuristic-delta-3600": true, - "heuristic-delta-43200": true, - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": true, - "heuristic-delta-600": true, - "heuristic-delta-86400": true, - "invalidate-DELETE": true, - "invalidate-DELETE-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-failed": true, - "invalidate-DELETE-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-failed": true, - "invalidate-M-SEARCH-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST": true, - "invalidate-POST-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-failed": true, - "invalidate-POST-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT": true, - "invalidate-PUT-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-failed": true, - "invalidate-PUT-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 age header not present." - ], - "other-age-gen": [ - "Assertion", - "Response 2 Age header not present." - ], - "other-age-update-expires": [ - "Assertion", - "Response 2 header Age is 30, should be bigger than 32" - ], - "other-age-update-max-age": [ - "Assertion", - "Response 2 header Age is 30, should be bigger than 32" - ], - "other-cookie": true, - "other-date-update": true, - "other-date-update-expires": true, - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": true, - "other-set-cookie": true, - "partial-store-complete-reuse-partial": true, - "partial-store-complete-reuse-partial-no-last": true, - "partial-store-complete-reuse-partial-suffix": true, - "partial-store-partial-complete": [ - "Assertion", - "Request 2 header range is \"undefined\", not \"bytes=5-\"" - ], - "partial-store-partial-reuse-partial": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-use-headers": true, - "partial-use-stored-headers": true, - "pragma-request-extension": true, - "pragma-request-no-cache": [ - "Assertion", - "Response 2 does not come from cache" - ], - "pragma-response-extension": true, - "pragma-response-no-cache": [ - "Assertion", - "Response 2 does not come from cache" - ], - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close": [ - "TypeError", - "Failed to fetch" - ], - "stale-close-must-revalidate": [ - "TypeError", - "Failed to fetch" - ], - "stale-close-no-cache": [ - "TypeError", - "Failed to fetch" - ], - "stale-sie-503": [ - "TypeError", - "Failed to fetch" - ], - "stale-sie-close": [ - "TypeError", - "Failed to fetch" - ], - "stale-warning-become": [ - "TypeError", - "Failed to fetch" - ], - "stale-warning-stored": [ - "TypeError", - "Failed to fetch" - ], - "stale-while-revalidate": true, - "stale-while-revalidate-window": true, - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": true, - "status-204-stale": true, - "status-299-fresh": true, - "status-299-stale": true, - "status-400-fresh": true, - "status-400-stale": true, - "status-404-fresh": true, - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": true, - "status-499-stale": true, - "status-500-fresh": true, - "status-500-stale": true, - "status-502-fresh": true, - "status-502-stale": true, - "status-503-fresh": true, - "status-503-stale": true, - "status-504-fresh": true, - "status-504-stale": true, - "status-599-fresh": true, - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": [ - "Assertion", - "Response 3 does not come from cache" - ], - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": true, - "vary-syntax-empty-star-lines": true, - "vary-syntax-foo-star": true, - "vary-syntax-star": true, - "vary-syntax-star-foo": true, - "vary-syntax-star-star": true, - "vary-syntax-star-star-lines": true -} \ No newline at end of file diff --git a/test/fixtures/cache-tests/results/fastly.json b/test/fixtures/cache-tests/results/fastly.json deleted file mode 100644 index bbf11332be0..00000000000 --- a/test/fixtures/cache-tests/results/fastly.json +++ /dev/null @@ -1,879 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": [ - "Assertion", - "Response 2 header Cache-Control is \"max-age=1\", not \"max-age=3600\"" - ], - "304-etag-update-response-Clear-Site-Data": [ - "Assertion", - "Response 2 header Clear-Site-Data is \"cache\", not \"cookies\"" - ], - "304-etag-update-response-Content-Encoding": [ - "Assertion", - "Response 2 header Content-Encoding is \"arizqhypgxofwne\", not \"askcumewogyqias\"" - ], - "304-etag-update-response-Content-Foo": [ - "Assertion", - "Response 2 header Content-Foo is \"awsokgcyuqmieaw\", not \"axurolifczwtqnk\"" - ], - "304-etag-update-response-Content-Length": true, - "304-etag-update-response-Content-Location": [ - "Assertion", - "Response 2 header Content-Location is \"/foo\", not \"/bar\"" - ], - "304-etag-update-response-Content-MD5": [ - "Assertion", - "Response 2 header Content-MD5 is \"rL0Y20zC+Fzt72VPzMSk2A==\", not \"N7UdGUp1E+RbVvZSTy1R8g==\"" - ], - "304-etag-update-response-Content-Range": [ - "Assertion", - "Response 2 header Content-Range is \"null\", not \"aqgwmcsiyoeukaq\"" - ], - "304-etag-update-response-Content-Security-Policy": [ - "Assertion", - "Response 2 header Content-Security-Policy is \"default-src 'self'\", not \"default-src 'self' cdn.example.com\"" - ], - "304-etag-update-response-Content-Type": [ - "Assertion", - "Response 2 header Content-Type is \"text/plain\", not \"text/plain;charset=utf-8\"" - ], - "304-etag-update-response-ETag": [ - "Assertion", - "Response 2 header ETag is \"\"abcdef\"\", not \"\"ghijkl\"\"" - ], - "304-etag-update-response-Expires": [ - "Assertion", - "Response 2 header Expires is \"Fri, 01 Jan 2038 01:01:01 GMT\", not \"Mon, 11 Jan 2038 11:11:11 GMT\"" - ], - "304-etag-update-response-Public-Key-Pins": [ - "Assertion", - "Response 2 header Public-Key-Pins is \"auoicwqkeysmgau\", not \"avqlgbwrmhcxsni\"" - ], - "304-etag-update-response-Set-Cookie": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Set-Cookie2": [ - "Assertion", - "Response 2 header Set-Cookie2 is \"a=b\", not \"a=c\"" - ], - "304-etag-update-response-Test-Header": [ - "Assertion", - "Response 2 header Test-Header is \"aaaaaaaaaaaaaaa\", not \"abcdefghijklmno\"" - ], - "304-etag-update-response-X-Content-Foo": [ - "Assertion", - "Response 2 header X-Content-Foo is \"azyxwvutsrqponm\", not \"aaaaaaaaaaaaaaa\"" - ], - "304-etag-update-response-X-Frame-Options": [ - "Assertion", - "Response 2 header X-Frame-Options is \"deny\", not \"sameorigin\"" - ], - "304-etag-update-response-X-Test-Header": [ - "Assertion", - "Response 2 header X-Test-Header is \"adgjmpsvybehknq\", not \"aeimquycgkoswae\"" - ], - "304-etag-update-response-X-XSS-Protection": [ - "Assertion", - "Response 2 header X-XSS-Protection is \"1\", not \"1; mode=block\"" - ], - "304-lm-use-stored-Test-Header": true, - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": true, - "age-parse-large": true, - "age-parse-large-minus-one": true, - "age-parse-larger": true, - "age-parse-negative": true, - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": true, - "age-parse-parameter": true, - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": true, - "age-parse-suffix-twoline": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": true, - "cc-resp-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "cc-resp-no-cache-case-insensitive": [ - "Assertion", - "Response 2 comes from cache" - ], - "cc-resp-no-cache-revalidate": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "cc-resp-no-cache-revalidate-fresh": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-shared": true, - "ccreq-ma0": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-ma1": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-magreaterage": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-max-stale": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-max-stale-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-min-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-min-fresh-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-no-cache-etag": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "ccreq-no-cache-lm": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "ccreq-no-store": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-oic": [ - "Assertion", - "Response 1 status is 200, not 504" - ], - "cdn-cc-invalid-sh-type-unknown": true, - "cdn-cc-invalid-sh-type-wrong": true, - "cdn-date-update-exceed": true, - "cdn-expires-update-exceed": [ - "Assertion", - "Response 2 header Expires is \"null\", not \"Tue, 21 Jan 2025 00:41:28 GMT\"" - ], - "cdn-fresh-cc-nostore": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-0": true, - "cdn-max-age-0-expires": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-age": true, - "cdn-max-age-case-insensitive": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-cc-max-age-invalid-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-extension": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-long-cc-max-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-max": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-max-plus": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-short-cc-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-space-after-equals": true, - "cdn-max-age-space-before-equals": true, - "cdn-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-no-store-cc-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-private": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-remove-age-exceed": [ - "Assertion", - "Response 2 Age header not present." - ], - "cdn-remove-header": true, - "conditional-304-etag": true, - "conditional-etag-forward": [ - "Assertion", - "Request 1 header If-None-Match is \"undefined\", not \"\"abcdef\"\"" - ], - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"undefined\", not \"\"abcdef\"\"" - ], - "conditional-etag-precedence": true, - "conditional-etag-quoted-respond-unquoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-strong-generate": true, - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-strong-respond": true, - "conditional-etag-strong-respond-multiple-first": true, - "conditional-etag-strong-respond-multiple-last": true, - "conditional-etag-strong-respond-multiple-second": true, - "conditional-etag-strong-respond-obs-text": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-quoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-unquoted": true, - "conditional-etag-vary-headers": true, - "conditional-etag-vary-headers-mismatch": true, - "conditional-etag-weak-generate-weak": true, - "conditional-etag-weak-respond": true, - "conditional-etag-weak-respond-backslash": true, - "conditional-etag-weak-respond-lowercase": true, - "conditional-etag-weak-respond-omit-slash": true, - "conditional-lm-fresh": true, - "conditional-lm-fresh-earlier": true, - "conditional-lm-fresh-no-lm": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh-rfc850": true, - "conditional-lm-stale": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-age-slow-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-ansi-c": true, - "freshness-expires-far-future": true, - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-2-digit-year": true, - "freshness-expires-invalid-aest": true, - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": true, - "freshness-expires-invalid-multiple-lines": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-multiple-spaces": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-no-comma": true, - "freshness-expires-invalid-time-periods": true, - "freshness-expires-invalid-utc": true, - "freshness-expires-old-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": true, - "freshness-expires-wrong-case-month": true, - "freshness-expires-wrong-case-tz": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-weekday": true, - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": true, - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-decimal-five": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-decimal-zero": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-s-maxage-shared-longer": true, - "freshness-max-age-s-maxage-shared-longer-multiple": true, - "freshness-max-age-s-maxage-shared-longer-reversed": true, - "freshness-max-age-s-maxage-shared-shorter": true, - "freshness-max-age-s-maxage-shared-shorter-expires": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-space-before-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": true, - "freshness-max-age-two-fresh-stale-sepline": true, - "freshness-max-age-two-stale-fresh-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-none": true, - "freshness-s-maxage-shared": true, - "head-200-freshness-update": [ - "Assertion", - "Request 2 had method GET, not HEAD" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Assertion", - "Request 2 had method GET, not HEAD" - ], - "head-410-update": [ - "Setup", - "Response 3 status is 410, not 200" - ], - "head-writethrough": [ - "Assertion", - "Request 2 had method GET, not HEAD" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-omit-headers-listed-in-Connection": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": [ - "Assertion", - "Response 2 header Content-Range is \"null\", not \"ananananananana\"" - ], - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-store-Set-Cookie2": true, - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": [ - "Setup", - "Response 1 status is 503, not 200" - ], - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-204-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": [ - "Setup", - "retry" - ], - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1800": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-30": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-300": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-3600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-43200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-86400": [ - "Assertion", - "Response 2 does not come from cache" - ], - "invalidate-DELETE": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-failed": true, - "invalidate-DELETE-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-failed": true, - "invalidate-M-SEARCH-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-failed": true, - "invalidate-POST-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-failed": true, - "invalidate-PUT-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 header age is 0, should be bigger than 0" - ], - "other-age-gen": true, - "other-age-update-expires": [ - "Assertion", - "Response 2 header Age is 3, should be bigger than 32" - ], - "other-age-update-max-age": true, - "other-authorization": [ - "Assertion", - "Response 2 comes from cache" - ], - "other-authorization-must-revalidate": true, - "other-authorization-public": true, - "other-authorization-smaxage": true, - "other-cookie": true, - "other-date-update": [ - "Assertion", - "Response 2 header Date is \"Tue, 21 Jan 2025 00:41:23 GMT\", not \"Tue, 21 Jan 2025 00:41:20 GMT\"" - ], - "other-date-update-expires": [ - "Assertion", - "Response 2 header Date is \"Tue, 21 Jan 2025 00:41:23 GMT\", not \"Tue, 21 Jan 2025 00:41:20 GMT\"" - ], - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-set-cookie": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-complete-reuse-partial": true, - "partial-store-complete-reuse-partial-no-last": true, - "partial-store-complete-reuse-partial-suffix": true, - "partial-store-partial-complete": [ - "Assertion", - "Request 2 header range is \"undefined\", not \"bytes=5-\"" - ], - "partial-store-partial-reuse-partial": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-use-headers": true, - "partial-use-stored-headers": true, - "pragma-request-extension": true, - "pragma-request-no-cache": true, - "pragma-response-extension": true, - "pragma-response-no-cache": true, - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": [ - "Setup", - "retry" - ], - "stale-close": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close-must-revalidate": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-close-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-close-proxy-revalidate": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-close-s-maxage=2": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-sie-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-sie-close": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-warning-become": [ - "Setup", - "Response 2 does not come from cache" - ], - "stale-warning-stored": [ - "Setup", - "Response 2 does not come from cache" - ], - "stale-while-revalidate": true, - "stale-while-revalidate-window": true, - "status-200-fresh": true, - "status-200-must-understand": true, - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-204-stale": true, - "status-299-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-299-stale": true, - "status-301-fresh": true, - "status-301-stale": true, - "status-302-fresh": true, - "status-302-stale": true, - "status-303-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-303-stale": true, - "status-307-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-307-stale": true, - "status-308-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-308-stale": true, - "status-400-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-400-stale": true, - "status-404-fresh": true, - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-499-stale": true, - "status-500-fresh": [ - "Setup", - "retry" - ], - "status-500-stale": [ - "Setup", - "retry" - ], - "status-502-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-502-stale": true, - "status-503-fresh": [ - "Setup", - "retry" - ], - "status-503-stale": [ - "Setup", - "retry" - ], - "status-504-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-504-stale": true, - "status-599-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": true, - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-empty-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-empty-star-lines": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-foo-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star-foo": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star-star-lines": [ - "Assertion", - "Response 2 comes from cache" - ] -} diff --git a/test/fixtures/cache-tests/results/firefox.json b/test/fixtures/cache-tests/results/firefox.json deleted file mode 100644 index 2c3e5a87e67..00000000000 --- a/test/fixtures/cache-tests/results/firefox.json +++ /dev/null @@ -1,581 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": true, - "304-etag-update-response-Clear-Site-Data": true, - "304-etag-update-response-Content-Encoding": [ - "Assertion", - "Response 2 header Content-Encoding is \"arizqhypgxofwne\", not \"askcumewogyqias\"" - ], - "304-etag-update-response-Content-Foo": true, - "304-etag-update-response-Content-Length": true, - "304-etag-update-response-Content-Location": [ - "Assertion", - "Response 2 header Content-Location is \"/foo\", not \"/bar\"" - ], - "304-etag-update-response-Content-MD5": [ - "Assertion", - "Response 2 header Content-MD5 is \"rL0Y20zC+Fzt72VPzMSk2A==\", not \"N7UdGUp1E+RbVvZSTy1R8g==\"" - ], - "304-etag-update-response-Content-Range": [ - "Assertion", - "Response 2 header Content-Range is \"apetixmbqfujync\", not \"aqgwmcsiyoeukaq\"" - ], - "304-etag-update-response-Content-Security-Policy": true, - "304-etag-update-response-Content-Type": [ - "Assertion", - "Response 2 header Content-Type is \"text/plain\", not \"text/plain;charset=utf-8\"" - ], - "304-etag-update-response-ETag": [ - "Assertion", - "Response 2 header ETag is \"\"abcdef\"\", not \"\"ghijkl\"\"" - ], - "304-etag-update-response-Expires": true, - "304-etag-update-response-Public-Key-Pins": true, - "304-etag-update-response-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "304-etag-update-response-Set-Cookie2": [ - "Assertion", - "Response 2 header Set-Cookie2 is \"null\", not \"a=c\"" - ], - "304-etag-update-response-Test-Header": true, - "304-etag-update-response-X-Content-Foo": true, - "304-etag-update-response-X-Frame-Options": true, - "304-etag-update-response-X-Test-Header": true, - "304-etag-update-response-X-XSS-Protection": true, - "304-lm-use-stored-Test-Header": true, - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-large": true, - "age-parse-large-minus-one": true, - "age-parse-larger": true, - "age-parse-negative": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": true, - "age-parse-parameter": true, - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": true, - "age-parse-suffix-twoline": true, - "cc-resp-immutable-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cc-resp-immutable-stale": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": true, - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": true, - "cc-resp-no-cache-revalidate-fresh": true, - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-private": true, - "ccreq-ma0": true, - "ccreq-ma1": true, - "ccreq-magreaterage": true, - "ccreq-max-stale": true, - "ccreq-max-stale-age": true, - "ccreq-min-fresh": true, - "ccreq-min-fresh-age": true, - "ccreq-no-cache": true, - "ccreq-no-cache-etag": true, - "ccreq-no-cache-lm": true, - "ccreq-no-store": true, - "ccreq-oic": [ - "Assertion", - "Response 1 status is 200, not 504" - ], - "conditional-etag-forward": true, - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-strong-generate": true, - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-vary-headers": true, - "conditional-etag-vary-headers-mismatch": [ - "Assertion", - "Request 2 header If-None-Match is \"\"abcdef\"\"" - ], - "conditional-etag-weak-generate-weak": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": true, - "freshness-expires-age-slow-date": true, - "freshness-expires-ansi-c": true, - "freshness-expires-far-future": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-2-digit-year": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-aest": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-multiple-lines": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-multiple-spaces": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-no-comma": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-time-periods": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-utc": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-old-date": true, - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": true, - "freshness-expires-wrong-case-month": true, - "freshness-expires-wrong-case-tz": true, - "freshness-expires-wrong-case-weekday": true, - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": true, - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": true, - "freshness-max-age-decimal-five": true, - "freshness-max-age-decimal-zero": true, - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-s-maxage-private": true, - "freshness-max-age-s-maxage-private-multiple": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-space-before-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-fresh-stale-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sameline": true, - "freshness-max-age-two-stale-fresh-sepline": true, - "freshness-none": true, - "head-200-freshness-update": [ - "Assertion", - "Response 3 does not come from cache" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-410-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-writethrough": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Connection": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": true, - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "headers-store-Set-Cookie2": [ - "Assertion", - "Response 2 header Set-Cookie2 is \"null\", not \"a=c\"" - ], - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": true, - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": true, - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": true, - "heuristic-204-cached": true, - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": true, - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": true, - "heuristic-delta-1800": true, - "heuristic-delta-30": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-300": true, - "heuristic-delta-3600": true, - "heuristic-delta-43200": true, - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": true, - "heuristic-delta-600": true, - "heuristic-delta-86400": true, - "invalidate-DELETE": true, - "invalidate-DELETE-cl": true, - "invalidate-DELETE-failed": [ - "Assertion", - "Response 3 does not come from cache" - ], - "invalidate-DELETE-location": true, - "invalidate-M-SEARCH": true, - "invalidate-M-SEARCH-cl": true, - "invalidate-M-SEARCH-failed": [ - "Assertion", - "Response 3 does not come from cache" - ], - "invalidate-M-SEARCH-location": true, - "invalidate-POST": true, - "invalidate-POST-cl": true, - "invalidate-POST-failed": [ - "Assertion", - "Response 3 does not come from cache" - ], - "invalidate-POST-location": true, - "invalidate-PUT": true, - "invalidate-PUT-cl": true, - "invalidate-PUT-failed": [ - "Assertion", - "Response 3 does not come from cache" - ], - "invalidate-PUT-location": true, - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 age header not present." - ], - "other-age-gen": [ - "Assertion", - "Response 2 Age header not present." - ], - "other-age-update-expires": [ - "Assertion", - "Response 2 header Age is 30, should be bigger than 32" - ], - "other-age-update-max-age": [ - "Assertion", - "Response 2 header Age is 30, should be bigger than 32" - ], - "other-cookie": true, - "other-date-update": true, - "other-date-update-expires": true, - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": true, - "other-set-cookie": true, - "partial-store-complete-reuse-partial": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-complete-reuse-partial-no-last": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-complete-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-complete": [ - "Assertion", - "Request 2 header range is \"undefined\", not \"bytes=5-\"" - ], - "partial-store-partial-reuse-partial": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-use-headers": [ - "Setup", - "Response 2 does not come from cache" - ], - "partial-use-stored-headers": [ - "Setup", - "Response 2 does not come from cache" - ], - "pragma-request-extension": true, - "pragma-request-no-cache": true, - "pragma-response-extension": true, - "pragma-response-no-cache": true, - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close": [ - "TypeError", - "NetworkError when attempting to fetch resource." - ], - "stale-close-must-revalidate": [ - "TypeError", - "NetworkError when attempting to fetch resource." - ], - "stale-close-no-cache": [ - "TypeError", - "NetworkError when attempting to fetch resource." - ], - "stale-sie-503": [ - "TypeError", - "NetworkError when attempting to fetch resource." - ], - "stale-sie-close": [ - "TypeError", - "NetworkError when attempting to fetch resource." - ], - "stale-warning-become": [ - "TypeError", - "NetworkError when attempting to fetch resource." - ], - "stale-warning-stored": [ - "TypeError", - "NetworkError when attempting to fetch resource." - ], - "stale-while-revalidate": true, - "stale-while-revalidate-window": true, - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": true, - "status-204-stale": true, - "status-299-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-299-stale": true, - "status-400-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-400-stale": true, - "status-404-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-499-stale": true, - "status-500-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-500-stale": true, - "status-502-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-502-stale": true, - "status-503-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-503-stale": true, - "status-504-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-504-stale": true, - "status-599-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": [ - "Assertion", - "Response 3 does not come from cache" - ], - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": true, - "vary-syntax-empty-star-lines": true, - "vary-syntax-foo-star": true, - "vary-syntax-star": true, - "vary-syntax-star-foo": true, - "vary-syntax-star-star": true, - "vary-syntax-star-star-lines": true -} \ No newline at end of file diff --git a/test/fixtures/cache-tests/results/haproxy.json b/test/fixtures/cache-tests/results/haproxy.json deleted file mode 100644 index 9b30c981005..00000000000 --- a/test/fixtures/cache-tests/results/haproxy.json +++ /dev/null @@ -1,859 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Clear-Site-Data": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Encoding": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Foo": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Length": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Location": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-MD5": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Range": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Security-Policy": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Content-Type": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-ETag": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Expires": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Public-Key-Pins": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Set-Cookie": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Set-Cookie2": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Test-Header": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-X-Content-Foo": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-X-Frame-Options": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-X-Test-Header": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-X-XSS-Protection": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-lm-use-stored-Test-Header": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "age-parse-dup-0": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-dup-0-twoline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-dup-old": true, - "age-parse-float": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-large": true, - "age-parse-large-minus-one": true, - "age-parse-larger": true, - "age-parse-negative": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-nonnumeric": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-numeric-parameter": true, - "age-parse-parameter": true, - "age-parse-prefix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-prefix-twoline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-suffix": true, - "age-parse-suffix-twoline": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": [ - "Assertion", - "Request 3 should have been conditional, but it was not." - ], - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "cc-resp-no-cache-revalidate-fresh": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-shared": true, - "ccreq-ma0": true, - "ccreq-ma1": true, - "ccreq-magreaterage": [ - "Setup", - "Response 1 header Age is \"null\", not \"1800\"" - ], - "ccreq-max-stale": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-max-stale-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-min-fresh": true, - "ccreq-min-fresh-age": [ - "Setup", - "Response 1 header Age is \"null\", not \"1000\"" - ], - "ccreq-no-cache": true, - "ccreq-no-cache-etag": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "ccreq-no-cache-lm": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "ccreq-no-store": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-oic": [ - "Assertion", - "Response 1 status is 200, not 504" - ], - "cdn-cc-invalid-sh-type-unknown": true, - "cdn-cc-invalid-sh-type-wrong": [ - "AbortError", - "This operation was aborted" - ], - "cdn-date-update-exceed": true, - "cdn-expires-update-exceed": [ - "Assertion", - "Response 2 header Expires is \"null\", not \"Wed, 12 Mar 2025 10:13:52 GMT\"" - ], - "cdn-fresh-cc-nostore": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-0": true, - "cdn-max-age-0-expires": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-age": true, - "cdn-max-age-case-insensitive": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-cc-max-age-invalid-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-extension": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-long-cc-max-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-max": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-max-plus": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-short-cc-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-space-after-equals": true, - "cdn-max-age-space-before-equals": true, - "cdn-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-no-store-cc-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-private": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-remove-age-exceed": [ - "Assertion", - "Response 2 Age header not present." - ], - "cdn-remove-header": true, - "conditional-304-etag": true, - "conditional-etag-forward": true, - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-precedence": true, - "conditional-etag-quoted-respond-unquoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-strong-generate": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "conditional-etag-strong-respond": true, - "conditional-etag-strong-respond-multiple-first": true, - "conditional-etag-strong-respond-multiple-last": true, - "conditional-etag-strong-respond-multiple-second": true, - "conditional-etag-strong-respond-obs-text": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-quoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-unquoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-vary-headers": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "conditional-etag-vary-headers-mismatch": true, - "conditional-etag-weak-generate-weak": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "conditional-etag-weak-respond": true, - "conditional-etag-weak-respond-backslash": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-weak-respond-lowercase": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-weak-respond-omit-slash": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh": true, - "conditional-lm-fresh-earlier": true, - "conditional-lm-fresh-no-lm": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh-rfc850": true, - "conditional-lm-stale": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-age-slow-date": true, - "freshness-expires-ansi-c": true, - "freshness-expires-far-future": true, - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": true, - "freshness-expires-invalid-2-digit-year": true, - "freshness-expires-invalid-aest": true, - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": true, - "freshness-expires-invalid-multiple-lines": true, - "freshness-expires-invalid-multiple-spaces": true, - "freshness-expires-invalid-no-comma": true, - "freshness-expires-invalid-time-periods": true, - "freshness-expires-invalid-utc": true, - "freshness-expires-old-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": true, - "freshness-expires-wrong-case-month": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-tz": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-weekday": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": true, - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-decimal-five": true, - "freshness-max-age-decimal-zero": true, - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": true, - "freshness-max-age-s-maxage-shared-longer": true, - "freshness-max-age-s-maxage-shared-longer-multiple": true, - "freshness-max-age-s-maxage-shared-longer-reversed": true, - "freshness-max-age-s-maxage-shared-shorter": true, - "freshness-max-age-s-maxage-shared-shorter-expires": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-space-before-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-fresh-stale-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sameline": true, - "freshness-max-age-two-stale-fresh-sepline": true, - "freshness-none": true, - "freshness-s-maxage-shared": true, - "head-200-freshness-update": [ - "Assertion", - "Response 3 does not come from cache" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-410-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-writethrough": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-omit-headers-listed-in-Connection": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": true, - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": true, - "headers-store-Set-Cookie2": true, - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": [ - "Setup", - "Response 1 status is 502, not 200" - ], - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": true, - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-204-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": true, - "heuristic-delta-1200": true, - "heuristic-delta-1800": true, - "heuristic-delta-30": true, - "heuristic-delta-300": true, - "heuristic-delta-3600": true, - "heuristic-delta-43200": true, - "heuristic-delta-5": true, - "heuristic-delta-60": true, - "heuristic-delta-600": true, - "heuristic-delta-86400": true, - "interim-102": true, - "interim-103": true, - "interim-no-header-reuse": true, - "interim-not-cached": true, - "invalidate-DELETE": true, - "invalidate-DELETE-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-failed": true, - "invalidate-DELETE-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH": true, - "invalidate-M-SEARCH-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-failed": true, - "invalidate-M-SEARCH-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST": true, - "invalidate-POST-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-failed": true, - "invalidate-POST-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT": true, - "invalidate-PUT-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-failed": true, - "invalidate-PUT-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 age header not present." - ], - "other-age-gen": true, - "other-age-update-expires": [ - "Setup", - "Response 1 header Age is \"null\", not \"30\"" - ], - "other-age-update-max-age": [ - "Setup", - "Response 1 header Age is \"null\", not \"30\"" - ], - "other-authorization": true, - "other-authorization-must-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-authorization-public": true, - "other-authorization-smaxage": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-cookie": true, - "other-date-update": true, - "other-date-update-expires": true, - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": true, - "other-set-cookie": true, - "partial-store-complete-reuse-partial": [ - "Assertion", - "Response 2 status is 200, not 206" - ], - "partial-store-complete-reuse-partial-no-last": [ - "Assertion", - "Response 2 status is 200, not 206" - ], - "partial-store-complete-reuse-partial-suffix": [ - "Assertion", - "Response 2 status is 200, not 206" - ], - "partial-store-partial-complete": [ - "Assertion", - "Request 2 header range is \"undefined\", not \"bytes=5-\"" - ], - "partial-store-partial-reuse-partial": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-use-headers": [ - "Setup", - "Response 2 status is 200, not 206" - ], - "partial-use-stored-headers": [ - "Setup", - "Response 2 status is 200, not 206" - ], - "pragma-request-extension": true, - "pragma-request-no-cache": true, - "pragma-response-extension": true, - "pragma-response-no-cache": [ - "Assertion", - "Response 2 does not come from cache" - ], - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close": [ - "TypeError", - "fetch failed" - ], - "stale-close-must-revalidate": [ - "TypeError", - "fetch failed" - ], - "stale-close-no-cache": [ - "TypeError", - "fetch failed" - ], - "stale-close-proxy-revalidate": [ - "TypeError", - "fetch failed" - ], - "stale-close-s-maxage=2": [ - "TypeError", - "fetch failed" - ], - "stale-sie-503": [ - "TypeError", - "fetch failed" - ], - "stale-sie-close": [ - "TypeError", - "fetch failed" - ], - "stale-warning-become": [ - "TypeError", - "fetch failed" - ], - "stale-warning-stored": [ - "TypeError", - "fetch failed" - ], - "stale-while-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-while-revalidate-window": [ - "Setup", - "Response 2 does not come from cache" - ], - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-203-stale": true, - "status-204-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-204-stale": true, - "status-299-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-299-stale": true, - "status-301-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-301-stale": true, - "status-302-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-302-stale": true, - "status-303-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-303-stale": true, - "status-307-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-307-stale": true, - "status-308-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-308-stale": true, - "status-400-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-400-stale": true, - "status-404-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-404-stale": true, - "status-410-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-410-stale": true, - "status-499-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-499-stale": true, - "status-500-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-500-stale": true, - "status-502-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-502-stale": true, - "status-503-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-503-stale": true, - "status-504-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-504-stale": true, - "status-599-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-3-no-match": true, - "vary-3-omit": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-3-order": true, - "vary-cache-key": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-invalidate": [ - "Assertion", - "Response 3 does not come from cache" - ], - "vary-match": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-no-match": true, - "vary-normalise-combine": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": true, - "vary-syntax-empty-star-lines": true, - "vary-syntax-foo-star": true, - "vary-syntax-star": true, - "vary-syntax-star-foo": true, - "vary-syntax-star-star": true, - "vary-syntax-star-star-lines": true -} diff --git a/test/fixtures/cache-tests/results/index.mjs b/test/fixtures/cache-tests/results/index.mjs deleted file mode 100644 index aaa7a525a18..00000000000 --- a/test/fixtures/cache-tests/results/index.mjs +++ /dev/null @@ -1,78 +0,0 @@ - -export default [ - { - file: 'chrome.json', - name: 'Chrome', - type: 'browser', - version: '132.0.6834.84' - }, - { - file: 'firefox.json', - name: 'Firefox', - type: 'browser', - version: '134.0.1', - link: 'https://github.com/http-tests/cache-tests/wiki/Firefox' - }, - { - file: 'safari.json', - name: 'Safari', - type: 'browser', - version: '18.2 (20620.1.16.11.8)' - }, - { - file: 'nginx.json', - name: 'nginx', - type: 'rev-proxy', - version: '1.26.0-3ubuntu1', - link: 'https://github.com/http-tests/cache-tests/wiki/nginx' - }, - { - file: 'squid.json', - name: 'Squid', - type: 'rev-proxy', - version: '6.10-1ubuntu1', - link: 'https://github.com/http-tests/cache-tests/wiki/Squid' - }, - { - file: 'trafficserver.json', - name: 'ATS', - type: 'rev-proxy', - version: '9.2.5+ds-1', - link: 'https://github.com/http-tests/cache-tests/wiki/Traffic-Server' - }, - { - file: 'apache.json', - name: 'httpd', - type: 'rev-proxy', - version: '2.4.62-3ubuntu1', - link: 'https://github.com/http-tests/cache-tests/wiki/Apache-httpd' - }, - { - file: 'varnish.json', - name: 'Varnish', - type: 'rev-proxy', - version: '7.5.0-3', - link: 'https://github.com/http-tests/cache-tests/wiki/Varnish' - }, - { - file: 'caddy.json', - name: 'caddy', - type: 'rev-proxy', - version: '0.7.0', - link: 'https://github.com/http-tests/cache-tests/wiki/Caddy' - }, - { - file: 'haproxy.json', - name: 'HAProxy', - type: 'rev-proxy', - version: '3.0.8-1ubuntu1', - link: 'https://github.com/http-tests/cache-tests/wiki/HAProxy' - }, - { - file: 'fastly.json', - name: 'Fastly', - type: 'cdn', - version: '2025-01-21', - link: 'https://github.com/http-tests/cache-tests/wiki/Fastly' - } -] diff --git a/test/fixtures/cache-tests/results/nginx.json b/test/fixtures/cache-tests/results/nginx.json deleted file mode 100644 index 2901dbe1353..00000000000 --- a/test/fixtures/cache-tests/results/nginx.json +++ /dev/null @@ -1,850 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": [ - "Assertion", - "Response 2 header Cache-Control is \"max-age=1\", not \"max-age=3600\"" - ], - "304-etag-update-response-Clear-Site-Data": [ - "Assertion", - "Response 2 header Clear-Site-Data is \"cache\", not \"cookies\"" - ], - "304-etag-update-response-Content-Encoding": [ - "Assertion", - "Response 2 header Content-Encoding is \"arizqhypgxofwne\", not \"askcumewogyqias\"" - ], - "304-etag-update-response-Content-Foo": [ - "Assertion", - "Response 2 header Content-Foo is \"awsokgcyuqmieaw\", not \"axurolifczwtqnk\"" - ], - "304-etag-update-response-Content-Length": true, - "304-etag-update-response-Content-Location": [ - "Assertion", - "Response 2 header Content-Location is \"/foo\", not \"/bar\"" - ], - "304-etag-update-response-Content-MD5": [ - "Assertion", - "Response 2 header Content-MD5 is \"rL0Y20zC+Fzt72VPzMSk2A==\", not \"N7UdGUp1E+RbVvZSTy1R8g==\"" - ], - "304-etag-update-response-Content-Range": [ - "Assertion", - "Response 2 header Content-Range is \"apetixmbqfujync\", not \"aqgwmcsiyoeukaq\"" - ], - "304-etag-update-response-Content-Security-Policy": [ - "Assertion", - "Response 2 header Content-Security-Policy is \"default-src 'self'\", not \"default-src 'self' cdn.example.com\"" - ], - "304-etag-update-response-Content-Type": [ - "Assertion", - "Response 2 header Content-Type is \"text/plain\", not \"text/plain;charset=utf-8\"" - ], - "304-etag-update-response-ETag": [ - "Assertion", - "Response 2 header ETag is \"\"abcdef\"\", not \"\"ghijkl\"\"" - ], - "304-etag-update-response-Expires": [ - "Assertion", - "Response 2 header Expires is \"Fri, 01 Jan 2038 01:01:01 GMT\", not \"Mon, 11 Jan 2038 11:11:11 GMT\"" - ], - "304-etag-update-response-Public-Key-Pins": [ - "Assertion", - "Response 2 header Public-Key-Pins is \"auoicwqkeysmgau\", not \"avqlgbwrmhcxsni\"" - ], - "304-etag-update-response-Set-Cookie": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Set-Cookie2": [ - "Assertion", - "Response 2 header Set-Cookie2 is \"a=b\", not \"a=c\"" - ], - "304-etag-update-response-Test-Header": [ - "Assertion", - "Response 2 header Test-Header is \"aaaaaaaaaaaaaaa\", not \"abcdefghijklmno\"" - ], - "304-etag-update-response-X-Content-Foo": [ - "Assertion", - "Response 2 header X-Content-Foo is \"azyxwvutsrqponm\", not \"aaaaaaaaaaaaaaa\"" - ], - "304-etag-update-response-X-Frame-Options": [ - "Assertion", - "Response 2 header X-Frame-Options is \"deny\", not \"sameorigin\"" - ], - "304-etag-update-response-X-Test-Header": [ - "Assertion", - "Response 2 header X-Test-Header is \"adgjmpsvybehknq\", not \"aeimquycgkoswae\"" - ], - "304-etag-update-response-X-XSS-Protection": [ - "Assertion", - "Response 2 header X-XSS-Protection is \"1\", not \"1; mode=block\"" - ], - "304-lm-use-stored-Test-Header": true, - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": true, - "age-parse-large": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-large-minus-one": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-larger": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-negative": true, - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-suffix-twoline": [ - "Assertion", - "Response 2 comes from cache" - ], - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": true, - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "cc-resp-no-cache-revalidate-fresh": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-shared": true, - "ccreq-ma0": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-ma1": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-magreaterage": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-max-stale": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-max-stale-age": true, - "ccreq-min-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-min-fresh-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-no-cache-etag": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "ccreq-no-cache-lm": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "ccreq-no-store": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-oic": [ - "Assertion", - "Response 1 status is 200, not 504" - ], - "cdn-cc-invalid-sh-type-unknown": true, - "cdn-cc-invalid-sh-type-wrong": true, - "cdn-date-update-exceed": true, - "cdn-expires-update-exceed": [ - "Assertion", - "Response 2 header Expires is \"null\", not \"Sat, 24 May 2025 02:01:29 GMT\"" - ], - "cdn-fresh-cc-nostore": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-0": true, - "cdn-max-age-0-expires": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-age": true, - "cdn-max-age-case-insensitive": [ - "AbortError", - "This operation was aborted" - ], - "cdn-max-age-cc-max-age-invalid-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-extension": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-long-cc-max-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-max": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-max-plus": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-short-cc-max-age": [ - "AbortError", - "This operation was aborted" - ], - "cdn-max-age-space-after-equals": true, - "cdn-max-age-space-before-equals": true, - "cdn-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-no-store-cc-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-private": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-remove-age-exceed": [ - "Assertion", - "Response 2 Age header not present." - ], - "cdn-remove-header": true, - "conditional-304-etag": true, - "conditional-etag-forward": [ - "Assertion", - "Request 1 header If-None-Match is \"undefined\", not \"\"abcdef\"\"" - ], - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"undefined\", not \"\"abcdef\"\"" - ], - "conditional-etag-precedence": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-quoted-respond-unquoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-strong-generate": true, - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-strong-respond": true, - "conditional-etag-strong-respond-multiple-first": true, - "conditional-etag-strong-respond-multiple-last": true, - "conditional-etag-strong-respond-multiple-second": true, - "conditional-etag-strong-respond-obs-text": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-quoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-unquoted": true, - "conditional-etag-vary-headers": true, - "conditional-etag-vary-headers-mismatch": true, - "conditional-etag-weak-generate-weak": true, - "conditional-etag-weak-respond": true, - "conditional-etag-weak-respond-backslash": true, - "conditional-etag-weak-respond-lowercase": true, - "conditional-etag-weak-respond-omit-slash": true, - "conditional-lm-fresh": true, - "conditional-lm-fresh-earlier": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh-no-lm": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh-rfc850": true, - "conditional-lm-stale": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-age-slow-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-ansi-c": true, - "freshness-expires-far-future": true, - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": true, - "freshness-expires-invalid-2-digit-year": true, - "freshness-expires-invalid-aest": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": true, - "freshness-expires-invalid-multiple-lines": true, - "freshness-expires-invalid-multiple-spaces": true, - "freshness-expires-invalid-no-comma": true, - "freshness-expires-invalid-time-periods": true, - "freshness-expires-invalid-utc": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-old-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-past": true, - "freshness-expires-present": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-rfc850": true, - "freshness-expires-wrong-case-month": true, - "freshness-expires-wrong-case-tz": true, - "freshness-expires-wrong-case-weekday": true, - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-decimal-five": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-decimal-zero": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-s-maxage-shared-longer": true, - "freshness-max-age-s-maxage-shared-longer-multiple": true, - "freshness-max-age-s-maxage-shared-longer-reversed": true, - "freshness-max-age-s-maxage-shared-shorter": true, - "freshness-max-age-s-maxage-shared-shorter-expires": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": true, - "freshness-max-age-space-before-equals": true, - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": true, - "freshness-max-age-two-fresh-stale-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sepline": true, - "freshness-none": true, - "freshness-s-maxage-shared": true, - "head-200-freshness-update": [ - "Assertion", - "Request 2 had method GET, not HEAD" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Assertion", - "Request 2 had method GET, not HEAD" - ], - "head-410-update": [ - "Setup", - "Response 3 status is 410, not 200" - ], - "head-writethrough": [ - "Assertion", - "Request 2 had method GET, not HEAD" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Connection": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": true, - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-store-Set-Cookie2": true, - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": [ - "Setup", - "Response 1 status is 502, not 200" - ], - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-204-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1800": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-30": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-300": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-3600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-43200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-86400": [ - "Assertion", - "Response 2 does not come from cache" - ], - "interim-102": [ - "AbortError", - "This operation was aborted" - ], - "interim-103": [ - "AbortError", - "This operation was aborted" - ], - "interim-no-header-reuse": [ - "AbortError", - "This operation was aborted" - ], - "interim-not-cached": [ - "AbortError", - "This operation was aborted" - ], - "invalidate-DELETE": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-failed": true, - "invalidate-DELETE-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-failed": true, - "invalidate-M-SEARCH-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-failed": true, - "invalidate-POST-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-failed": true, - "invalidate-PUT-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 age header not present." - ], - "other-age-gen": [ - "Assertion", - "Response 2 Age header not present." - ], - "other-age-update-expires": [ - "Assertion", - "Response 2 header Age is 30, should be bigger than 32" - ], - "other-age-update-max-age": [ - "Assertion", - "Response 2 header Age is 30, should be bigger than 32" - ], - "other-authorization": [ - "Assertion", - "Response 2 comes from cache" - ], - "other-authorization-must-revalidate": true, - "other-authorization-public": true, - "other-authorization-smaxage": true, - "other-cookie": true, - "other-date-update": [ - "Assertion", - "Response 2 header Date is \"Sat, 24 May 2025 02:00:49 GMT\", not \"Sat, 24 May 2025 02:00:46 GMT\"" - ], - "other-date-update-expires": [ - "Assertion", - "Response 2 header Date is \"Sat, 24 May 2025 02:00:49 GMT\", not \"Sat, 24 May 2025 02:00:46 GMT\"" - ], - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-set-cookie": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-complete-reuse-partial": [ - "Assertion", - "Response 2 status is 200, not 206" - ], - "partial-store-complete-reuse-partial-no-last": [ - "Assertion", - "Response 2 status is 200, not 206" - ], - "partial-store-complete-reuse-partial-suffix": [ - "Assertion", - "Response 2 status is 200, not 206" - ], - "partial-store-partial-complete": [ - "Setup", - "Response 2 status is 206, not 200" - ], - "partial-store-partial-reuse-partial": [ - "Setup", - "Request 1 header Range is \"undefined\", not \"bytes=-5\"" - ], - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response body is \"01234\", not \"234\"" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response body is \"01234\", not \"234\"" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response body is \"01234\", not \"4\"" - ], - "partial-use-headers": [ - "Setup", - "Response 2 status is 200, not 206" - ], - "partial-use-stored-headers": [ - "Setup", - "Response 2 status is 200, not 206" - ], - "pragma-request-extension": true, - "pragma-request-no-cache": true, - "pragma-response-extension": true, - "pragma-response-no-cache": true, - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close-must-revalidate": true, - "stale-close-no-cache": true, - "stale-close-proxy-revalidate": true, - "stale-close-s-maxage=2": true, - "stale-sie-503": true, - "stale-sie-close": true, - "stale-warning-become": [ - "Setup", - "Response 2 does not come from cache" - ], - "stale-warning-stored": [ - "Setup", - "Response 2 does not come from cache" - ], - "stale-while-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-while-revalidate-window": [ - "Setup", - "Response 2 does not come from cache" - ], - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": true, - "status-204-stale": true, - "status-299-fresh": true, - "status-299-stale": true, - "status-301-fresh": true, - "status-301-stale": true, - "status-302-fresh": true, - "status-302-stale": true, - "status-303-fresh": true, - "status-303-stale": true, - "status-307-fresh": true, - "status-307-stale": true, - "status-308-fresh": true, - "status-308-stale": true, - "status-400-fresh": true, - "status-400-stale": true, - "status-404-fresh": true, - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": true, - "status-499-stale": true, - "status-500-fresh": true, - "status-500-stale": true, - "status-502-fresh": true, - "status-502-stale": true, - "status-503-fresh": true, - "status-503-stale": true, - "status-504-fresh": true, - "status-504-stale": true, - "status-599-fresh": true, - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": true, - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": true, - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-empty-star-lines": true, - "vary-syntax-foo-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star": true, - "vary-syntax-star-foo": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star-star-lines": true -} diff --git a/test/fixtures/cache-tests/results/safari.json b/test/fixtures/cache-tests/results/safari.json deleted file mode 100644 index dfbedaa4cf9..00000000000 --- a/test/fixtures/cache-tests/results/safari.json +++ /dev/null @@ -1,611 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": true, - "304-etag-update-response-Clear-Site-Data": true, - "304-etag-update-response-Content-Encoding": [ - "Assertion", - "Response 2 header Content-Encoding is \"arizqhypgxofwne\", not \"askcumewogyqias\"" - ], - "304-etag-update-response-Content-Foo": [ - "Assertion", - "Response 2 header Content-Foo is \"awsokgcyuqmieaw\", not \"axurolifczwtqnk\"" - ], - "304-etag-update-response-Content-Length": true, - "304-etag-update-response-Content-Location": [ - "Assertion", - "Response 2 header Content-Location is \"/foo\", not \"/bar\"" - ], - "304-etag-update-response-Content-MD5": [ - "Assertion", - "Response 2 header Content-MD5 is \"rL0Y20zC+Fzt72VPzMSk2A==\", not \"N7UdGUp1E+RbVvZSTy1R8g==\"" - ], - "304-etag-update-response-Content-Range": [ - "Assertion", - "Response 2 header Content-Range is \"apetixmbqfujync\", not \"aqgwmcsiyoeukaq\"" - ], - "304-etag-update-response-Content-Security-Policy": true, - "304-etag-update-response-Content-Type": [ - "Assertion", - "Response 2 header Content-Type is \"text/plain\", not \"text/plain;charset=utf-8\"" - ], - "304-etag-update-response-ETag": [ - "Assertion", - "Response 2 header ETag is \"\"abcdef\"\", not \"\"ghijkl\"\"" - ], - "304-etag-update-response-Expires": true, - "304-etag-update-response-Public-Key-Pins": true, - "304-etag-update-response-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "304-etag-update-response-Set-Cookie2": [ - "Assertion", - "Response 2 header Set-Cookie2 is \"null\", not \"a=c\"" - ], - "304-etag-update-response-Test-Header": true, - "304-etag-update-response-X-Content-Foo": [ - "Assertion", - "Response 2 header X-Content-Foo is \"azyxwvutsrqponm\", not \"aaaaaaaaaaaaaaa\"" - ], - "304-etag-update-response-X-Frame-Options": [ - "Assertion", - "Response 2 header X-Frame-Options is \"deny\", not \"sameorigin\"" - ], - "304-etag-update-response-X-Test-Header": true, - "304-etag-update-response-X-XSS-Protection": [ - "Assertion", - "Response 2 header X-XSS-Protection is \"1\", not \"1; mode=block\"" - ], - "304-lm-use-stored-Test-Header": true, - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-large": true, - "age-parse-large-minus-one": true, - "age-parse-larger": true, - "age-parse-negative": true, - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-suffix-twoline": [ - "Assertion", - "Response 2 comes from cache" - ], - "cc-resp-immutable-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cc-resp-immutable-stale": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": true, - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": true, - "cc-resp-no-cache-revalidate-fresh": true, - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-private": true, - "ccreq-ma0": true, - "ccreq-ma1": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-magreaterage": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-max-stale": true, - "ccreq-max-stale-age": true, - "ccreq-min-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-min-fresh-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-no-cache": true, - "ccreq-no-cache-etag": true, - "ccreq-no-cache-lm": true, - "ccreq-no-store": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-oic": [ - "TypeError", - "Load failed" - ], - "conditional-etag-forward": true, - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-strong-generate": true, - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-vary-headers": true, - "conditional-etag-vary-headers-mismatch": true, - "conditional-etag-weak-generate-weak": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": true, - "freshness-expires-age-slow-date": true, - "freshness-expires-ansi-c": true, - "freshness-expires-far-future": true, - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-2-digit-year": true, - "freshness-expires-invalid-aest": true, - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-multiple-lines": true, - "freshness-expires-invalid-multiple-spaces": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-no-comma": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-time-periods": true, - "freshness-expires-invalid-utc": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-old-date": true, - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-month": true, - "freshness-expires-wrong-case-tz": true, - "freshness-expires-wrong-case-weekday": true, - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": true, - "freshness-max-age-decimal-five": true, - "freshness-max-age-decimal-zero": true, - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": true, - "freshness-max-age-s-maxage-private": true, - "freshness-max-age-s-maxage-private-multiple": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-space-before-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": true, - "freshness-max-age-two-fresh-stale-sepline": true, - "freshness-max-age-two-stale-fresh-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-none": true, - "head-200-freshness-update": [ - "Assertion", - "Response 3 does not come from cache" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-410-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-writethrough": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-omit-headers-listed-in-Connection": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": true, - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "headers-store-Set-Cookie2": [ - "Assertion", - "Response 2 header Set-Cookie2 is \"null\", not \"a=c\"" - ], - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": true, - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": true, - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": true, - "heuristic-204-cached": true, - "heuristic-403-not_cached": true, - "heuristic-404-cached": true, - "heuristic-405-cached": true, - "heuristic-410-cached": true, - "heuristic-414-cached": true, - "heuristic-501-cached": true, - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": true, - "heuristic-delta-1800": true, - "heuristic-delta-30": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-300": true, - "heuristic-delta-3600": true, - "heuristic-delta-43200": true, - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": true, - "heuristic-delta-600": true, - "heuristic-delta-86400": true, - "invalidate-DELETE": true, - "invalidate-DELETE-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-failed": [ - "Assertion", - "Response 3 does not come from cache" - ], - "invalidate-DELETE-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH": true, - "invalidate-M-SEARCH-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-failed": [ - "Assertion", - "Response 3 does not come from cache" - ], - "invalidate-M-SEARCH-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST": true, - "invalidate-POST-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-failed": [ - "Assertion", - "Response 3 does not come from cache" - ], - "invalidate-POST-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT": true, - "invalidate-PUT-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-failed": [ - "Assertion", - "Response 3 does not come from cache" - ], - "invalidate-PUT-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 age header not present." - ], - "other-age-gen": [ - "Assertion", - "Response 2 Age header not present." - ], - "other-age-update-expires": [ - "Assertion", - "Response 2 header Age is 30, should be bigger than 32" - ], - "other-age-update-max-age": [ - "Assertion", - "Response 2 header Age is 30, should be bigger than 32" - ], - "other-cookie": true, - "other-date-update": true, - "other-date-update-expires": true, - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": true, - "other-set-cookie": true, - "partial-store-complete-reuse-partial": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-complete-reuse-partial-no-last": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-complete-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-complete": [ - "Assertion", - "Request 2 header range is \"undefined\", not \"bytes=5-\"" - ], - "partial-store-partial-reuse-partial": true, - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-use-headers": [ - "Setup", - "Response 2 does not come from cache" - ], - "partial-use-stored-headers": [ - "Setup", - "Response 2 does not come from cache" - ], - "pragma-request-extension": true, - "pragma-request-no-cache": [ - "Assertion", - "Response 2 does not come from cache" - ], - "pragma-response-extension": true, - "pragma-response-no-cache": [ - "Assertion", - "Response 2 does not come from cache" - ], - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close": [ - "TypeError", - "Load failed" - ], - "stale-close-must-revalidate": [ - "TypeError", - "Load failed" - ], - "stale-close-no-cache": [ - "TypeError", - "Load failed" - ], - "stale-sie-503": [ - "TypeError", - "Load failed" - ], - "stale-sie-close": [ - "TypeError", - "Load failed" - ], - "stale-warning-become": [ - "TypeError", - "Load failed" - ], - "stale-warning-stored": [ - "TypeError", - "Load failed" - ], - "stale-while-revalidate": true, - "stale-while-revalidate-window": true, - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": true, - "status-204-stale": true, - "status-299-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-299-stale": true, - "status-400-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-400-stale": true, - "status-404-fresh": true, - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-499-stale": true, - "status-500-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-500-stale": true, - "status-502-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-502-stale": true, - "status-503-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-503-stale": true, - "status-504-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-504-stale": true, - "status-599-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": [ - "Assertion", - "Response 3 does not come from cache" - ], - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": true, - "vary-syntax-empty-star-lines": true, - "vary-syntax-foo-star": true, - "vary-syntax-star": true, - "vary-syntax-star-foo": true, - "vary-syntax-star-star": true, - "vary-syntax-star-star-lines": true -} \ No newline at end of file diff --git a/test/fixtures/cache-tests/results/squid.json b/test/fixtures/cache-tests/results/squid.json deleted file mode 100644 index ae7e31fdbe2..00000000000 --- a/test/fixtures/cache-tests/results/squid.json +++ /dev/null @@ -1,676 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": true, - "304-etag-update-response-Clear-Site-Data": true, - "304-etag-update-response-Content-Encoding": true, - "304-etag-update-response-Content-Foo": true, - "304-etag-update-response-Content-Length": [ - "Assertion", - "Response 2 header Content-Length is \"10\", not \"36\"" - ], - "304-etag-update-response-Content-Location": true, - "304-etag-update-response-Content-MD5": true, - "304-etag-update-response-Content-Range": true, - "304-etag-update-response-Content-Security-Policy": true, - "304-etag-update-response-Content-Type": true, - "304-etag-update-response-ETag": true, - "304-etag-update-response-Expires": true, - "304-etag-update-response-Public-Key-Pins": true, - "304-etag-update-response-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "304-etag-update-response-Set-Cookie2": true, - "304-etag-update-response-Test-Header": true, - "304-etag-update-response-X-Content-Foo": true, - "304-etag-update-response-X-Frame-Options": true, - "304-etag-update-response-X-Test-Header": true, - "304-etag-update-response-X-XSS-Protection": true, - "304-lm-use-stored-Test-Header": true, - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-large": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-large-minus-one": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-larger": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-negative": true, - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": true, - "age-parse-parameter": true, - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": true, - "age-parse-suffix-twoline": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": true, - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": true, - "cc-resp-no-cache-revalidate-fresh": true, - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-shared": true, - "ccreq-ma0": true, - "ccreq-ma1": true, - "ccreq-magreaterage": true, - "ccreq-max-stale": true, - "ccreq-max-stale-age": true, - "ccreq-min-fresh": true, - "ccreq-min-fresh-age": true, - "ccreq-no-cache": true, - "ccreq-no-cache-etag": [ - "Setup", - "Response 2 status is 502, not 200" - ], - "ccreq-no-cache-lm": [ - "Setup", - "Response 2 status is 502, not 200" - ], - "ccreq-no-store": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-oic": true, - "cdn-cc-invalid-sh-type-unknown": true, - "cdn-cc-invalid-sh-type-wrong": true, - "cdn-date-update-exceed": true, - "cdn-expires-update-exceed": [ - "Assertion", - "Response 2 header Expires is \"null\", not \"Sat, 24 May 2025 02:00:04 GMT\"" - ], - "cdn-fresh-cc-nostore": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-0": true, - "cdn-max-age-0-expires": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-age": true, - "cdn-max-age-case-insensitive": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-cc-max-age-invalid-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-extension": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-long-cc-max-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-max": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-max-plus": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-short-cc-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-space-after-equals": true, - "cdn-max-age-space-before-equals": true, - "cdn-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-no-store-cc-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-private": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-remove-age-exceed": [ - "Assertion", - "Response 2 Age header not present." - ], - "cdn-remove-header": true, - "conditional-304-etag": [ - "Assertion", - "Response 2 header ETag is \"null\", not \"\"abcdef\"\"" - ], - "conditional-etag-forward": true, - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-precedence": true, - "conditional-etag-quoted-respond-unquoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-strong-generate": true, - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "request 2 doesn't have if-none-match header" - ], - "conditional-etag-strong-respond": true, - "conditional-etag-strong-respond-multiple-first": true, - "conditional-etag-strong-respond-multiple-last": true, - "conditional-etag-strong-respond-multiple-second": true, - "conditional-etag-strong-respond-obs-text": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-quoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-unquoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-vary-headers": true, - "conditional-etag-vary-headers-mismatch": true, - "conditional-etag-weak-generate-weak": [ - "Assertion", - "request 2 doesn't have if-none-match header" - ], - "conditional-etag-weak-respond": true, - "conditional-etag-weak-respond-backslash": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-weak-respond-lowercase": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-weak-respond-omit-slash": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh": true, - "conditional-lm-fresh-earlier": true, - "conditional-lm-fresh-no-lm": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh-rfc850": true, - "conditional-lm-stale": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-age-slow-date": true, - "freshness-expires-ansi-c": true, - "freshness-expires-far-future": true, - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": true, - "freshness-expires-invalid-2-digit-year": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-aest": true, - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-multiple-lines": true, - "freshness-expires-invalid-multiple-spaces": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-no-comma": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-time-periods": true, - "freshness-expires-invalid-utc": true, - "freshness-expires-old-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": true, - "freshness-expires-wrong-case-month": true, - "freshness-expires-wrong-case-tz": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-weekday": true, - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": true, - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": true, - "freshness-max-age-decimal-five": true, - "freshness-max-age-decimal-zero": true, - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-negative": true, - "freshness-max-age-quoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-s-maxage-shared-longer": true, - "freshness-max-age-s-maxage-shared-longer-multiple": true, - "freshness-max-age-s-maxage-shared-longer-reversed": true, - "freshness-max-age-s-maxage-shared-shorter": true, - "freshness-max-age-s-maxage-shared-shorter-expires": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-space-before-equals": true, - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": true, - "freshness-max-age-two-fresh-stale-sepline": true, - "freshness-max-age-two-stale-fresh-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-none": true, - "freshness-s-maxage-shared": true, - "head-200-freshness-update": [ - "Assertion", - "Response 3 does not come from cache" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-410-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-writethrough": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Connection": true, - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": true, - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "headers-store-Set-Cookie2": true, - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": [ - "Setup", - "Response 1 status is 502, not 200" - ], - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": true, - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": true, - "heuristic-204-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": true, - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": true, - "heuristic-delta-1800": true, - "heuristic-delta-30": true, - "heuristic-delta-300": true, - "heuristic-delta-3600": true, - "heuristic-delta-43200": true, - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": true, - "heuristic-delta-600": true, - "heuristic-delta-86400": true, - "interim-102": true, - "interim-103": true, - "interim-no-header-reuse": true, - "interim-not-cached": true, - "invalidate-DELETE": true, - "invalidate-DELETE-cl": true, - "invalidate-DELETE-failed": true, - "invalidate-DELETE-location": true, - "invalidate-M-SEARCH": true, - "invalidate-M-SEARCH-cl": true, - "invalidate-M-SEARCH-failed": [ - "Assertion", - "Response 3 does not come from cache" - ], - "invalidate-M-SEARCH-location": true, - "invalidate-POST": true, - "invalidate-POST-cl": true, - "invalidate-POST-failed": true, - "invalidate-POST-location": true, - "invalidate-PUT": [ - "Setup", - "Response 1 status is 409, not 200" - ], - "invalidate-PUT-cl": true, - "invalidate-PUT-failed": true, - "invalidate-PUT-location": true, - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 age header not present." - ], - "other-age-gen": true, - "other-age-update-expires": true, - "other-age-update-max-age": true, - "other-authorization": [ - "Setup", - "Request 1 header Authorization is \"undefined\", not \"FOO\"" - ], - "other-authorization-must-revalidate": [ - "Setup", - "Request 1 header Authorization is \"undefined\", not \"FOO\"" - ], - "other-authorization-public": [ - "Setup", - "Request 1 header Authorization is \"undefined\", not \"FOO\"" - ], - "other-authorization-smaxage": [ - "Setup", - "Request 1 header Authorization is \"undefined\", not \"FOO\"" - ], - "other-cookie": true, - "other-date-update": true, - "other-date-update-expires": true, - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": true, - "other-set-cookie": true, - "partial-store-complete-reuse-partial": true, - "partial-store-complete-reuse-partial-no-last": true, - "partial-store-complete-reuse-partial-suffix": true, - "partial-store-partial-complete": [ - "Assertion", - "Request 2 header range is \"undefined\", not \"bytes=5-\"" - ], - "partial-store-partial-reuse-partial": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-use-headers": true, - "partial-use-stored-headers": true, - "pragma-request-extension": true, - "pragma-request-no-cache": [ - "Assertion", - "Response 2 does not come from cache" - ], - "pragma-response-extension": true, - "pragma-response-no-cache": true, - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": true, - "stale-close": true, - "stale-close-must-revalidate": true, - "stale-close-no-cache": true, - "stale-close-proxy-revalidate": true, - "stale-close-s-maxage=2": true, - "stale-sie-503": true, - "stale-sie-close": true, - "stale-warning-become": [ - "Assertion", - "Response 2 warning header not present." - ], - "stale-warning-stored": [ - "Assertion", - "Response 2 warning header not present." - ], - "stale-while-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-while-revalidate-window": [ - "Setup", - "Response 2 does not come from cache" - ], - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-204-stale": true, - "status-299-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-299-stale": true, - "status-301-fresh": true, - "status-301-stale": true, - "status-302-fresh": true, - "status-302-stale": true, - "status-303-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-303-stale": true, - "status-307-fresh": true, - "status-307-stale": true, - "status-308-fresh": true, - "status-308-stale": true, - "status-400-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-400-stale": true, - "status-404-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-499-stale": true, - "status-500-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-500-stale": true, - "status-502-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-502-stale": true, - "status-503-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-503-stale": true, - "status-504-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-504-stale": true, - "status-599-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": true, - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": true, - "vary-syntax-empty-star-lines": true, - "vary-syntax-foo-star": true, - "vary-syntax-star": true, - "vary-syntax-star-foo": true, - "vary-syntax-star-star": true, - "vary-syntax-star-star-lines": true -} diff --git a/test/fixtures/cache-tests/results/trafficserver.json b/test/fixtures/cache-tests/results/trafficserver.json deleted file mode 100644 index 3c76b05ef04..00000000000 --- a/test/fixtures/cache-tests/results/trafficserver.json +++ /dev/null @@ -1,682 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": true, - "304-etag-update-response-Clear-Site-Data": true, - "304-etag-update-response-Content-Encoding": true, - "304-etag-update-response-Content-Foo": true, - "304-etag-update-response-Content-Length": true, - "304-etag-update-response-Content-Location": true, - "304-etag-update-response-Content-MD5": true, - "304-etag-update-response-Content-Range": true, - "304-etag-update-response-Content-Security-Policy": true, - "304-etag-update-response-Content-Type": [ - "Assertion", - "Response 2 header Content-Type is \"text/plain\", not \"text/plain;charset=utf-8\"" - ], - "304-etag-update-response-ETag": true, - "304-etag-update-response-Expires": true, - "304-etag-update-response-Public-Key-Pins": true, - "304-etag-update-response-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "304-etag-update-response-Set-Cookie2": true, - "304-etag-update-response-Test-Header": true, - "304-etag-update-response-X-Content-Foo": true, - "304-etag-update-response-X-Frame-Options": true, - "304-etag-update-response-X-Test-Header": true, - "304-etag-update-response-X-XSS-Protection": true, - "304-lm-use-stored-Test-Header": true, - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-large": true, - "age-parse-large-minus-one": true, - "age-parse-larger": true, - "age-parse-negative": true, - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": true, - "age-parse-parameter": true, - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": true, - "age-parse-suffix-twoline": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": true, - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "cc-resp-no-cache-revalidate-fresh": true, - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-shared": true, - "ccreq-ma0": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-ma1": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-magreaterage": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-max-stale": true, - "ccreq-max-stale-age": true, - "ccreq-min-fresh": true, - "ccreq-min-fresh-age": true, - "ccreq-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-no-cache-etag": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "ccreq-no-cache-lm": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "ccreq-no-store": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-oic": true, - "cdn-cc-invalid-sh-type-unknown": true, - "cdn-cc-invalid-sh-type-wrong": true, - "cdn-date-update-exceed": true, - "cdn-expires-update-exceed": [ - "Assertion", - "Response 2 header Expires is \"null\", not \"Sat, 24 May 2025 02:03:28 GMT\"" - ], - "cdn-fresh-cc-nostore": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-0": true, - "cdn-max-age-0-expires": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-age": true, - "cdn-max-age-case-insensitive": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-cc-max-age-invalid-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-extension": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-long-cc-max-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-max": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-max-plus": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-short-cc-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-space-after-equals": true, - "cdn-max-age-space-before-equals": true, - "cdn-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-no-store-cc-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-private": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-remove-age-exceed": true, - "cdn-remove-header": true, - "conditional-304-etag": true, - "conditional-etag-forward": [ - "Assertion", - "Request 1 header If-None-Match is \"undefined\", not \"\"abcdef\"\"" - ], - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"undefined\", not \"\"abcdef\"\"" - ], - "conditional-etag-precedence": true, - "conditional-etag-quoted-respond-unquoted": true, - "conditional-etag-strong-generate": true, - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-strong-respond": true, - "conditional-etag-strong-respond-multiple-first": true, - "conditional-etag-strong-respond-multiple-last": true, - "conditional-etag-strong-respond-multiple-second": true, - "conditional-etag-strong-respond-obs-text": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-quoted": true, - "conditional-etag-unquoted-respond-unquoted": true, - "conditional-etag-vary-headers": true, - "conditional-etag-vary-headers-mismatch": true, - "conditional-etag-weak-generate-weak": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "conditional-etag-weak-respond": true, - "conditional-etag-weak-respond-backslash": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-weak-respond-lowercase": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-weak-respond-omit-slash": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh": true, - "conditional-lm-fresh-earlier": true, - "conditional-lm-fresh-no-lm": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh-rfc850": true, - "conditional-lm-stale": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": true, - "freshness-expires-age-slow-date": true, - "freshness-expires-ansi-c": true, - "freshness-expires-far-future": true, - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-2-digit-year": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-aest": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-multiple-lines": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-multiple-spaces": true, - "freshness-expires-invalid-no-comma": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-invalid-time-periods": true, - "freshness-expires-invalid-utc": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-old-date": true, - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": true, - "freshness-expires-wrong-case-month": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-tz": true, - "freshness-expires-wrong-case-weekday": true, - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": true, - "freshness-max-age-a100": true, - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": true, - "freshness-max-age-decimal-five": true, - "freshness-max-age-decimal-zero": true, - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": true, - "freshness-max-age-s-maxage-shared-longer": true, - "freshness-max-age-s-maxage-shared-longer-multiple": true, - "freshness-max-age-s-maxage-shared-longer-reversed": true, - "freshness-max-age-s-maxage-shared-shorter": true, - "freshness-max-age-s-maxage-shared-shorter-expires": true, - "freshness-max-age-single-quoted": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-space-after-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-space-before-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-fresh-stale-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sameline": true, - "freshness-max-age-two-stale-fresh-sepline": true, - "freshness-none": true, - "freshness-s-maxage-shared": true, - "head-200-freshness-update": [ - "Assertion", - "Response 3 does not come from cache" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-410-update": [ - "Setup", - "Response 3 does not come from cache" - ], - "head-writethrough": true, - "headers-omit-headers-listed-in-Cache-Control-no-cache": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Connection": [ - "Assertion", - "Response 2 includes unexpected header a: \"1\"" - ], - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": true, - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": [ - "Assertion", - "Response 2 header Set-Cookie is \"null\", not \"a=c\"" - ], - "headers-store-Set-Cookie2": true, - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": [ - "Setup", - "Response 1 status is 400, not 200" - ], - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": true, - "heuristic-204-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": true, - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": true, - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1800": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-30": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-300": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-3600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-43200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-86400": [ - "Assertion", - "Response 2 does not come from cache" - ], - "interim-102": [ - "AbortError", - "This operation was aborted" - ], - "interim-103": [ - "Assertion", - "Interim response 1 not received" - ], - "interim-no-header-reuse": [ - "Assertion", - "Interim response 1 not received" - ], - "interim-not-cached": [ - "Assertion", - "Interim response 1 not received" - ], - "invalidate-DELETE": [ - "Setup", - "Response 2 status is 403, not 200" - ], - "invalidate-DELETE-cl": [ - "Setup", - "Response 2 status is 403, not 200" - ], - "invalidate-DELETE-failed": [ - "Setup", - "Response 2 status is 403, not 500" - ], - "invalidate-DELETE-location": [ - "Setup", - "Response 2 status is 403, not 200" - ], - "invalidate-M-SEARCH": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-failed": true, - "invalidate-M-SEARCH-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST": true, - "invalidate-POST-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-failed": true, - "invalidate-POST-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT": true, - "invalidate-PUT-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-failed": true, - "invalidate-PUT-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": true, - "other-age-gen": true, - "other-age-update-expires": true, - "other-age-update-max-age": true, - "other-authorization": [ - "Assertion", - "Response 2 comes from cache" - ], - "other-authorization-must-revalidate": true, - "other-authorization-public": true, - "other-authorization-smaxage": true, - "other-cookie": true, - "other-date-update": true, - "other-date-update-expires": true, - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-set-cookie": true, - "partial-store-complete-reuse-partial": true, - "partial-store-complete-reuse-partial-no-last": true, - "partial-store-complete-reuse-partial-suffix": true, - "partial-store-partial-complete": [ - "Assertion", - "Request 2 header range is \"undefined\", not \"bytes=5-\"" - ], - "partial-store-partial-reuse-partial": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-absent": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-use-headers": true, - "partial-use-stored-headers": true, - "pragma-request-extension": true, - "pragma-request-no-cache": true, - "pragma-response-extension": true, - "pragma-response-no-cache": [ - "Assertion", - "Response 2 does not come from cache" - ], - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": true, - "stale-close": true, - "stale-close-must-revalidate": true, - "stale-close-no-cache": true, - "stale-close-proxy-revalidate": true, - "stale-close-s-maxage=2": true, - "stale-sie-503": true, - "stale-sie-close": true, - "stale-warning-become": true, - "stale-warning-stored": true, - "stale-while-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-while-revalidate-window": [ - "Setup", - "Response 2 does not come from cache" - ], - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": true, - "status-204-stale": true, - "status-299-fresh": true, - "status-299-stale": true, - "status-301-fresh": true, - "status-301-stale": true, - "status-302-fresh": true, - "status-302-stale": true, - "status-303-fresh": true, - "status-303-stale": true, - "status-307-fresh": true, - "status-307-stale": true, - "status-308-fresh": true, - "status-308-stale": true, - "status-400-fresh": true, - "status-400-stale": true, - "status-404-fresh": true, - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": true, - "status-499-stale": true, - "status-500-fresh": true, - "status-500-stale": true, - "status-502-fresh": true, - "status-502-stale": true, - "status-503-fresh": true, - "status-503-stale": true, - "status-504-fresh": true, - "status-504-stale": true, - "status-599-fresh": true, - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": true, - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": true, - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": true, - "vary-normalise-space": true, - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": true, - "vary-syntax-empty-star-lines": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-foo-star": true, - "vary-syntax-star": true, - "vary-syntax-star-foo": true, - "vary-syntax-star-star": true, - "vary-syntax-star-star-lines": true -} diff --git a/test/fixtures/cache-tests/results/varnish.json b/test/fixtures/cache-tests/results/varnish.json deleted file mode 100644 index 062cec8f4cb..00000000000 --- a/test/fixtures/cache-tests/results/varnish.json +++ /dev/null @@ -1,805 +0,0 @@ -{ - "304-etag-update-response-Cache-Control": true, - "304-etag-update-response-Clear-Site-Data": true, - "304-etag-update-response-Content-Encoding": [ - "Assertion", - "Response 2 header Content-Encoding is \"arizqhypgxofwne\", not \"askcumewogyqias\"" - ], - "304-etag-update-response-Content-Foo": true, - "304-etag-update-response-Content-Length": true, - "304-etag-update-response-Content-Location": true, - "304-etag-update-response-Content-MD5": true, - "304-etag-update-response-Content-Range": [ - "Setup", - "Response 1 status is 503, not 200" - ], - "304-etag-update-response-Content-Security-Policy": true, - "304-etag-update-response-Content-Type": true, - "304-etag-update-response-ETag": true, - "304-etag-update-response-Expires": true, - "304-etag-update-response-Public-Key-Pins": true, - "304-etag-update-response-Set-Cookie": [ - "Setup", - "Request 2 should have been conditional, but it was not." - ], - "304-etag-update-response-Set-Cookie2": true, - "304-etag-update-response-Test-Header": true, - "304-etag-update-response-X-Content-Foo": true, - "304-etag-update-response-X-Frame-Options": true, - "304-etag-update-response-X-Test-Header": true, - "304-etag-update-response-X-XSS-Protection": true, - "304-lm-use-stored-Test-Header": true, - "age-parse-dup-0": true, - "age-parse-dup-0-twoline": true, - "age-parse-dup-old": true, - "age-parse-float": [ - "Assertion", - "Response 2 does not come from cache" - ], - "age-parse-large": true, - "age-parse-large-minus-one": true, - "age-parse-larger": true, - "age-parse-negative": true, - "age-parse-nonnumeric": true, - "age-parse-numeric-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-parameter": [ - "Assertion", - "Response 2 comes from cache" - ], - "age-parse-prefix": true, - "age-parse-prefix-twoline": true, - "age-parse-suffix": true, - "age-parse-suffix-twoline": true, - "cc-resp-must-revalidate-fresh": true, - "cc-resp-must-revalidate-stale": true, - "cc-resp-no-cache": true, - "cc-resp-no-cache-case-insensitive": true, - "cc-resp-no-cache-revalidate": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "cc-resp-no-cache-revalidate-fresh": [ - "Assertion", - "Request 2 should have been conditional, but it was not." - ], - "cc-resp-no-store": true, - "cc-resp-no-store-case-insensitive": true, - "cc-resp-no-store-fresh": true, - "cc-resp-no-store-old-max-age": true, - "cc-resp-no-store-old-new": true, - "cc-resp-private-shared": true, - "ccreq-ma0": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-ma1": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-magreaterage": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-max-stale": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-max-stale-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "ccreq-min-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-min-fresh-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-no-cache-etag": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "ccreq-no-cache-lm": [ - "Assertion", - "request 2 wasn't sent to server" - ], - "ccreq-no-store": [ - "Assertion", - "Response 2 comes from cache" - ], - "ccreq-oic": [ - "Assertion", - "Response 1 status is 200, not 504" - ], - "cdn-cc-invalid-sh-type-unknown": true, - "cdn-cc-invalid-sh-type-wrong": true, - "cdn-date-update-exceed": true, - "cdn-expires-update-exceed": [ - "Assertion", - "Response 2 header Expires is \"null\", not \"Sat, 24 May 2025 02:12:22 GMT\"" - ], - "cdn-fresh-cc-nostore": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-0": true, - "cdn-max-age-0-expires": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-age": true, - "cdn-max-age-case-insensitive": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-cc-max-age-invalid-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-expires": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-extension": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-long-cc-max-age": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-max-age-max": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-max-plus": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-short-cc-max-age": [ - "Assertion", - "Response 2 does not come from cache" - ], - "cdn-max-age-space-after-equals": true, - "cdn-max-age-space-before-equals": true, - "cdn-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-no-store-cc-fresh": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-private": [ - "Assertion", - "Response 2 comes from cache" - ], - "cdn-remove-age-exceed": true, - "cdn-remove-header": true, - "conditional-304-etag": true, - "conditional-etag-forward": [ - "Assertion", - "Request 1 header If-None-Match is \"undefined\", not \"\"abcdef\"\"" - ], - "conditional-etag-forward-unquoted": [ - "Assertion", - "Request 1 header If-None-Match is \"undefined\", not \"\"abcdef\"\"" - ], - "conditional-etag-precedence": true, - "conditional-etag-quoted-respond-unquoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-strong-generate": true, - "conditional-etag-strong-generate-unquoted": [ - "Assertion", - "Request 2 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" - ], - "conditional-etag-strong-respond": true, - "conditional-etag-strong-respond-multiple-first": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-strong-respond-multiple-last": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-strong-respond-multiple-second": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-strong-respond-obs-text": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-quoted": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-etag-unquoted-respond-unquoted": true, - "conditional-etag-vary-headers": true, - "conditional-etag-vary-headers-mismatch": true, - "conditional-etag-weak-generate-weak": true, - "conditional-etag-weak-respond": true, - "conditional-etag-weak-respond-backslash": true, - "conditional-etag-weak-respond-lowercase": true, - "conditional-etag-weak-respond-omit-slash": true, - "conditional-lm-fresh": true, - "conditional-lm-fresh-earlier": true, - "conditional-lm-fresh-no-lm": [ - "Assertion", - "Response 2 status is 200, not 304" - ], - "conditional-lm-fresh-rfc850": true, - "conditional-lm-stale": true, - "freshness-expires-32bit": true, - "freshness-expires-age-fast-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-expires-age-slow-date": true, - "freshness-expires-ansi-c": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-far-future": true, - "freshness-expires-future": true, - "freshness-expires-invalid": true, - "freshness-expires-invalid-1-digit-hour": true, - "freshness-expires-invalid-2-digit-year": true, - "freshness-expires-invalid-aest": true, - "freshness-expires-invalid-date": true, - "freshness-expires-invalid-date-dashes": true, - "freshness-expires-invalid-multiple-lines": true, - "freshness-expires-invalid-multiple-spaces": true, - "freshness-expires-invalid-no-comma": true, - "freshness-expires-invalid-time-periods": true, - "freshness-expires-invalid-utc": true, - "freshness-expires-old-date": true, - "freshness-expires-past": true, - "freshness-expires-present": true, - "freshness-expires-rfc850": true, - "freshness-expires-wrong-case-month": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-tz": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-expires-wrong-case-weekday": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age": true, - "freshness-max-age-0": true, - "freshness-max-age-0-expires": true, - "freshness-max-age-100a": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-a100": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-age": true, - "freshness-max-age-case-insenstive": true, - "freshness-max-age-date": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-decimal-five": true, - "freshness-max-age-decimal-zero": true, - "freshness-max-age-expires": true, - "freshness-max-age-expires-invalid": true, - "freshness-max-age-extension": true, - "freshness-max-age-ignore-quoted": true, - "freshness-max-age-ignore-quoted-rev": true, - "freshness-max-age-leading-zero": true, - "freshness-max-age-max": true, - "freshness-max-age-max-minus-1": true, - "freshness-max-age-max-plus": true, - "freshness-max-age-max-plus-1": true, - "freshness-max-age-negative": true, - "freshness-max-age-quoted": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-s-maxage-shared-longer": true, - "freshness-max-age-s-maxage-shared-longer-multiple": true, - "freshness-max-age-s-maxage-shared-longer-reversed": true, - "freshness-max-age-s-maxage-shared-shorter": true, - "freshness-max-age-s-maxage-shared-shorter-expires": true, - "freshness-max-age-single-quoted": true, - "freshness-max-age-space-after-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-space-before-equals": [ - "Assertion", - "Response 2 comes from cache" - ], - "freshness-max-age-stale": true, - "freshness-max-age-two-fresh-stale-sameline": true, - "freshness-max-age-two-fresh-stale-sepline": true, - "freshness-max-age-two-stale-fresh-sameline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-max-age-two-stale-fresh-sepline": [ - "Assertion", - "Response 2 does not come from cache" - ], - "freshness-none": true, - "freshness-s-maxage-shared": true, - "head-200-freshness-update": [ - "Assertion", - "Request 2 had method GET, not HEAD" - ], - "head-200-retain": [ - "Assertion", - "Response 2 header Template-A is \"null\", not \"1\"" - ], - "head-200-update": [ - "Assertion", - "Request 2 had method GET, not HEAD" - ], - "head-410-update": [ - "Setup", - "Response 3 status is 410, not 200" - ], - "head-writethrough": [ - "Assertion", - "Request 2 had method GET, not HEAD" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Cache-Control-no-cache-single": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-omit-headers-listed-in-Connection": true, - "headers-store-Cache-Control": true, - "headers-store-Clear-Site-Data": true, - "headers-store-Connection": true, - "headers-store-Content-Encoding": true, - "headers-store-Content-Foo": true, - "headers-store-Content-Length": true, - "headers-store-Content-Location": true, - "headers-store-Content-MD5": true, - "headers-store-Content-Range": [ - "Setup", - "Response 1 status is 503, not 200" - ], - "headers-store-Content-Security-Policy": true, - "headers-store-Content-Type": true, - "headers-store-ETag": true, - "headers-store-Expires": true, - "headers-store-Keep-Alive": true, - "headers-store-Proxy-Authenticate": true, - "headers-store-Proxy-Authentication-Info": true, - "headers-store-Proxy-Authorization": true, - "headers-store-Proxy-Connection": true, - "headers-store-Public-Key-Pins": true, - "headers-store-Set-Cookie": [ - "Setup", - "Response 2 does not come from cache" - ], - "headers-store-Set-Cookie2": true, - "headers-store-TE": true, - "headers-store-Test-Header": true, - "headers-store-Transfer-Encoding": [ - "Setup", - "Response 1 status is 503, not 200" - ], - "headers-store-Upgrade": true, - "headers-store-X-Content-Foo": true, - "headers-store-X-Frame-Options": true, - "headers-store-X-Test-Header": true, - "headers-store-X-XSS-Protection": true, - "heuristic-200-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-201-not_cached": true, - "heuristic-202-not_cached": true, - "heuristic-203-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-204-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-403-not_cached": true, - "heuristic-404-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-405-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-410-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-414-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-501-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-502-not_cached": true, - "heuristic-503-not_cached": true, - "heuristic-504-not_cached": true, - "heuristic-599-cached": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-599-not_cached": true, - "heuristic-delta-10": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-1800": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-30": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-300": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-3600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-43200": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-5": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-60": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-600": [ - "Assertion", - "Response 2 does not come from cache" - ], - "heuristic-delta-86400": [ - "Assertion", - "Response 2 does not come from cache" - ], - "interim-102": [ - "Setup", - "Response 1 status is 503, not 200" - ], - "interim-103": [ - "Setup", - "Response 1 status is 503, not 200" - ], - "interim-no-header-reuse": [ - "Setup", - "Response 1 status is 503, not 200" - ], - "interim-not-cached": [ - "Setup", - "Response 1 status is 503, not 200" - ], - "invalidate-DELETE": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-DELETE-failed": true, - "invalidate-DELETE-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-M-SEARCH-failed": true, - "invalidate-M-SEARCH-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-POST-failed": true, - "invalidate-POST-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-cl": [ - "Assertion", - "Response 3 comes from cache" - ], - "invalidate-PUT-failed": true, - "invalidate-PUT-location": [ - "Assertion", - "Response 3 comes from cache" - ], - "method-POST": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-age-delay": [ - "Assertion", - "Response 1 header age is 0, should be bigger than 0" - ], - "other-age-gen": true, - "other-age-update-expires": true, - "other-age-update-max-age": true, - "other-authorization": true, - "other-authorization-must-revalidate": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-authorization-public": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-authorization-smaxage": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-cookie": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-date-update": true, - "other-date-update-expires": true, - "other-date-update-expires-update": true, - "other-fresh-content-disposition-attachment": true, - "other-heuristic-content-disposition-attachment": [ - "Assertion", - "Response 2 does not come from cache" - ], - "other-set-cookie": [ - "Assertion", - "Response 2 does not come from cache" - ], - "partial-store-complete-reuse-partial": true, - "partial-store-complete-reuse-partial-no-last": true, - "partial-store-complete-reuse-partial-suffix": true, - "partial-store-partial-complete": [ - "Setup", - "Response 1 status is 503, not 206" - ], - "partial-store-partial-reuse-partial": [ - "Setup", - "Response 1 status is 503, not 206" - ], - "partial-store-partial-reuse-partial-absent": [ - "Setup", - "Response 1 status is 503, not 206" - ], - "partial-store-partial-reuse-partial-byterange": [ - "Setup", - "Response 1 status is 503, not 206" - ], - "partial-store-partial-reuse-partial-suffix": [ - "Setup", - "Response 1 status is 503, not 206" - ], - "partial-use-headers": true, - "partial-use-stored-headers": true, - "pragma-request-extension": true, - "pragma-request-no-cache": true, - "pragma-response-extension": true, - "pragma-response-no-cache": true, - "pragma-response-no-cache-heuristic": [ - "Assertion", - "Response 2 does not come from cache" - ], - "query-args-different": true, - "query-args-same": true, - "stale-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-close-must-revalidate": true, - "stale-close-no-cache": true, - "stale-close-proxy-revalidate": true, - "stale-close-s-maxage=2": true, - "stale-sie-503": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-sie-close": [ - "Assertion", - "Response 2 does not come from cache" - ], - "stale-warning-become": [ - "Setup", - "Response 2 does not come from cache" - ], - "stale-warning-stored": [ - "Setup", - "Response 2 does not come from cache" - ], - "stale-while-revalidate": true, - "stale-while-revalidate-window": true, - "status-200-fresh": true, - "status-200-must-understand": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-200-stale": true, - "status-203-fresh": true, - "status-203-stale": true, - "status-204-fresh": true, - "status-204-stale": true, - "status-299-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-299-stale": true, - "status-301-fresh": true, - "status-301-stale": true, - "status-302-fresh": true, - "status-302-stale": true, - "status-303-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-303-stale": true, - "status-307-fresh": true, - "status-307-stale": true, - "status-308-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-308-stale": true, - "status-400-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-400-stale": true, - "status-404-fresh": true, - "status-404-stale": true, - "status-410-fresh": true, - "status-410-stale": true, - "status-499-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-499-stale": true, - "status-500-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-500-stale": true, - "status-502-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-502-stale": true, - "status-503-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-503-stale": true, - "status-504-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-504-stale": true, - "status-599-fresh": [ - "Assertion", - "Response 2 does not come from cache" - ], - "status-599-must-understand": true, - "status-599-stale": true, - "vary-2-match": true, - "vary-2-match-omit": true, - "vary-2-no-match": true, - "vary-3-match": true, - "vary-3-no-match": true, - "vary-3-omit": true, - "vary-3-order": true, - "vary-cache-key": true, - "vary-invalidate": true, - "vary-match": true, - "vary-no-match": true, - "vary-normalise-combine": true, - "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-order": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-select": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-lang-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-normalise-space": [ - "Assertion", - "Response 2 does not come from cache" - ], - "vary-omit": true, - "vary-omit-stored": true, - "vary-star": true, - "vary-syntax-empty-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-empty-star-lines": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-foo-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star": true, - "vary-syntax-star-foo": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star-star": [ - "Assertion", - "Response 2 comes from cache" - ], - "vary-syntax-star-star-lines": [ - "Assertion", - "Response 2 comes from cache" - ] -} diff --git a/test/fixtures/cache-tests/test-engine/cli.mjs b/test/fixtures/cache-tests/test-engine/cli.mjs deleted file mode 100644 index 2493a51a9c5..00000000000 --- a/test/fixtures/cache-tests/test-engine/cli.mjs +++ /dev/null @@ -1,43 +0,0 @@ -import { runTests, getResults } from './client/runner.mjs' -import { determineTestResult } from './lib/results.mjs' -import { GREEN, NC } from './lib/defines.mjs' -import tests from '../tests/index.mjs' - -const baseUrl = process.env.npm_config_base || process.env.npm_package_config_base -const testId = process.env.npm_config_id || process.env.npm_package_config_id - -let testsToRun -if (testId !== '') { - console.log(`Running ${testId}`) - tests.forEach(suite => { - suite.tests.forEach(test => { - if (test.id === testId) { - test.dump = true - testsToRun = [{ - name: suite.name, - id: suite.id, - description: suite.description, - tests: [test] - }] - } - }) - }) -} else { - testsToRun = tests -} - -await runTests(testsToRun, false, baseUrl).catch(err => { - console.error(err) - process.exit(1) -}) - -const results = getResults() - -if (testId !== '') { - console.log(`${GREEN}==== Results${NC}`) - const resultSymbol = determineTestResult(tests, testId, results, false) - const resultDetails = results[testId][1] || '' - console.log(`${resultSymbol[2]} - ${resultDetails}`) -} else { - console.log(JSON.stringify(results, null, 2)) -} diff --git a/test/fixtures/cache-tests/test-engine/client/config.mjs b/test/fixtures/cache-tests/test-engine/client/config.mjs deleted file mode 100644 index 11aa7910992..00000000000 --- a/test/fixtures/cache-tests/test-engine/client/config.mjs +++ /dev/null @@ -1,11 +0,0 @@ -export let useBrowserCache = false -export let baseUrl = '' -export const requestTimeout = 10 // seconds - -export function setUseBrowserCache (bool) { - if (bool !== undefined) useBrowserCache = bool -} - -export function setBaseUrl (url) { - if (url !== undefined) baseUrl = url -} diff --git a/test/fixtures/cache-tests/test-engine/client/fetching.mjs b/test/fixtures/cache-tests/test-engine/client/fetching.mjs deleted file mode 100644 index e1260da1e7f..00000000000 --- a/test/fixtures/cache-tests/test-engine/client/fetching.mjs +++ /dev/null @@ -1,45 +0,0 @@ -import * as config from './config.mjs' -import { fixupHeader } from '../lib/header-fixup.mjs' - -export function init (idx, reqConfig, prevResp) { - const init = { - headers: [] - } - if (!config.useBrowserCache) { - init.cache = 'no-store' - init.headers.push(['Pragma', 'foo']) // dirty hack for Fetch - init.headers.push(['Cache-Control', 'nothing-to-see-here']) // ditto - } - if ('request_method' in reqConfig) init.method = reqConfig.request_method - if ('request_headers' in reqConfig) init.headers = init.headers.concat(reqConfig.request_headers) - if ('magic_ims' in reqConfig && reqConfig.magic_ims === true) { - for (let i = 0; i < init.headers.length; i++) { - const header = init.headers[i] - if (header[0].toLowerCase() === 'if-modified-since') { - init.headers[i] = fixupHeader(header, prevResp, reqConfig) - } - } - } - if ('name' in reqConfig) init.headers.push(['Test-Name', reqConfig.name]) - if ('request_body' in reqConfig) init.body = reqConfig.request_body - if ('mode' in reqConfig) init.mode = reqConfig.mode - if ('credentials' in reqConfig) init.mode = reqConfig.credentials - if ('cache' in reqConfig) init.cache = reqConfig.cache - if ('redirect' in reqConfig) init.redirect = reqConfig.redirect - init.headers.push(['Test-ID', reqConfig.id]) - init.headers.push(['Req-Num', (idx + 1).toString()]) - return init -} - -export function inflateRequests (test) { - const rawRequests = test.requests - const requests = [] - for (let i = 0; i < rawRequests.length; i++) { - const reqConfig = rawRequests[i] - reqConfig.name = test.name - reqConfig.id = test.id - reqConfig.dump = test.dump - requests.push(reqConfig) - } - return requests -} diff --git a/test/fixtures/cache-tests/test-engine/client/runner.mjs b/test/fixtures/cache-tests/test-engine/client/runner.mjs deleted file mode 100644 index 9c7426e658c..00000000000 --- a/test/fixtures/cache-tests/test-engine/client/runner.mjs +++ /dev/null @@ -1,40 +0,0 @@ -import * as config from './config.mjs' -import { makeTest, testResults } from './test.mjs' - -export async function runTests (tests, browserCache, base, chunkSize = 25) { - config.setBaseUrl(base) - config.setUseBrowserCache(browserCache) - - const testArray = [] - tests.forEach(testSet => { - testSet.tests.forEach(test => { - if (test.id === undefined) throw new Error('Missing test id') - if (test.browser_only === true && !config.useBrowserCache === true) return - if (test.cdn_only === true && config.useBrowserCache === true) return - // note: still runs cdn tests on rev-proxy - if (test.browser_skip === true && config.useBrowserCache === true) return - testArray.push(test) - }) - }) - return runSome(testArray, chunkSize) -} - -export function getResults () { - const ordered = {} - Object.keys(testResults).sort().forEach(key => { - ordered[key] = testResults[key] - }) - return ordered -} - -async function runSome (tests, chunkSize) { - let index = 0 - function next () { - if (index < tests.length) { - const these = tests.slice(index, index + chunkSize).map(makeTest) - index += chunkSize - return Promise.all(these).then(next) - } - } - return next() -} diff --git a/test/fixtures/cache-tests/test-engine/client/test.mjs b/test/fixtures/cache-tests/test-engine/client/test.mjs deleted file mode 100644 index fb08d807e42..00000000000 --- a/test/fixtures/cache-tests/test-engine/client/test.mjs +++ /dev/null @@ -1,341 +0,0 @@ -import * as defines from '../lib/defines.mjs' -import { fixupHeader } from '../lib/header-fixup.mjs' -import * as utils from '../lib/utils.mjs' -import * as config from './config.mjs' -import * as clientUtils from './utils.mjs' -import * as fetching from './fetching.mjs' -const assert = utils.assert -const setupCheck = clientUtils.setupCheck - -export const testUUIDs = {} -export const testResults = {} - -export async function makeTest (test) { - const uuid = utils.token() - testUUIDs[test.id] = uuid - const requests = fetching.inflateRequests(test) - const responses = [] - const fetchFunctions = [] - for (let i = 0; i < requests.length; ++i) { - fetchFunctions.push({ - code: async idx => { - const reqConfig = requests[idx] - const reqNum = idx + 1 - const url = clientUtils.makeTestUrl(uuid, reqConfig) - let prevRes - if (i > 0) { - prevRes = Object.fromEntries(responses[i - 1].headers) - } - const init = fetching.init(idx, reqConfig, prevRes) - const controller = new AbortController() - const timeout = setTimeout(() => { - controller.abort() - }, config.requestTimeout * 1000) - init.signal = controller.signal - - const interimResponses = [] - if ('expected_interim_responses' in reqConfig) { - // Dynamic import since undici is only available in Node.js - const undici = await import('undici') - const dispatcher = new undici.Agent().compose(clientUtils.interimResponsesCollectingInterceptor(interimResponses)) - init.dispatcher = dispatcher - } - - if (test.dump === true) clientUtils.logRequest(url, init, reqNum) - return fetch(url, init) - .then(response => { - responses.push(response) - return checkResponse(test, requests, idx, response, interimResponses) - }) - .finally(() => { - clearTimeout(timeout) - }) - }, - pauseAfter: 'pause_after' in requests[i] - }) - } - - let idx = 0 - function runNextStep () { - if (fetchFunctions.length) { - const nextFetchFunction = fetchFunctions.shift() - if (nextFetchFunction.pauseAfter === true) { - return nextFetchFunction.code(idx++) - .then(clientUtils.pause) - .then(runNextStep) - } else { - return nextFetchFunction.code(idx++) - .then(runNextStep) - } - } - } - - function handleError (err) { - console.error(`ERROR: ${uuid} ${err.name} ${err.message}`) - } - - return clientUtils.putTestConfig(uuid, requests) - .catch(handleError) - .then(runNextStep) - .then(() => { - return clientUtils.getServerState(uuid) - }) - .then(serverState => { - checkServerRequests(requests, responses, serverState) - }) - .then(() => { // pass - if (test.id in testResults) throw new Error(`Duplicate test ${test.id}`) - testResults[test.id] = true - }) - .catch(err => { // fail - if (test.id in testResults) throw new Error(`Duplicate test ${test.id}`) - testResults[test.id] = [(err.name || 'unknown'), err.message] - }) -} - -function checkResponse (test, requests, idx, response, interimResponses) { - const reqNum = idx + 1 - const reqConfig = requests[idx] - const resNum = parseInt(response.headers.get('Server-Request-Count')) - if (test.dump === true) clientUtils.logResponse(response, interimResponses, reqNum) - - // catch retries - if (response.headers.has('Request-Numbers')) { - const serverRequests = response.headers.get('Request-Numbers').split(' ').map(item => parseInt(item)) - if (serverRequests.length !== new Set(serverRequests).size) { - assert(true, false, 'retry') - } - } - - // check response type - if ('expected_type' in reqConfig) { - const typeSetup = setupCheck(reqConfig, 'expected_type') - if (reqConfig.expected_type === 'cached') { - if (response.status === 304 && isNaN(resNum)) { // some caches will not include the hdr - // pass - } else { - assert(typeSetup, resNum < reqNum, `Response ${reqNum} does not come from cache`) - } - } - if (reqConfig.expected_type === 'not_cached') { - assert(typeSetup, resNum === reqNum, `Response ${reqNum} comes from cache`) - } - } - - // check response status - if ('expected_status' in reqConfig) { - if (reqConfig.expected_status !== null) { - assert(setupCheck(reqConfig, 'expected_status'), - response.status === reqConfig.expected_status, - `Response ${reqNum} status is ${response.status}, not ${reqConfig.expected_status}`) - } - } else if ('response_status' in reqConfig) { - assert(true, // response status is always setup - response.status === reqConfig.response_status[0], - `Response ${reqNum} status is ${response.status}, not ${reqConfig.response_status[0]}`) - } else if (response.status === 999) { - // special condition; the server thought it should have received a conditional request. - assert(setupCheck(reqConfig, 'expected_type'), false, - `Request ${reqNum} should have been conditional, but it was not.`) - } else { - assert(true, // default status is always setup - response.status === 200, - `Response ${reqNum} status is ${response.status}, not 200`) - } - - // check response headers - if ('expected_response_headers' in reqConfig) { - const respPresentSetup = setupCheck(reqConfig, 'expected_response_headers') - reqConfig.expected_response_headers.forEach(header => { - if (typeof header === 'string') { - assert(respPresentSetup, response.headers.has(header), - `Response ${reqNum} ${header} header not present.`) - } else if (header.length > 2) { - assert(respPresentSetup, response.headers.has(header[0]), - `Response ${reqNum} ${header[0]} header not present.`) - - const value = response.headers.get(header[0]) - let msg, condition - if (header[1] === '=') { - const expected = response.headers.get(header[2]) - condition = value === expected - msg = `match ${header[2]} (${expected})` - } else if (header[1] === '>') { - const expected = header[2] - condition = parseInt(value) > expected - msg = `be bigger than ${expected}` - } else { - throw new Error(`Unknown expected-header operator '${header[1]}'`) - } - - assert(respPresentSetup, condition, - `Response ${reqNum} header ${header[0]} is ${value}, should ${msg}`) - } else { - const expectedValue = fixupHeader( - header, Object.fromEntries(response.headers), reqConfig)[1] - assert(respPresentSetup, response.headers.get(header[0]) === expectedValue, - `Response ${reqNum} header ${header[0]} is "${response.headers.get(header[0])}", not "${expectedValue}"`) - } - }) - } - if ('expected_response_headers_missing' in reqConfig) { - const respMissingSetup = setupCheck(reqConfig, 'expected_response_headers_missing') - reqConfig.expected_response_headers_missing.forEach(header => { - if (typeof header === 'string') { - assert(respMissingSetup, !response.headers.has(header), - `Response ${reqNum} includes unexpected header ${header}: "${response.headers.get(header)}"`) - } else if (header.length === 2) { - if (response.headers.has(header[0]) && response.headers[header[0]]) { - const hdrValue = response.headers[header[0]] - assert(respMissingSetup, hdrValue.indexOf(header[1]) === -1, `Response ${reqNum} header ${header[0]} still has value "${hdrValue}"`) - } - } else { - throw new Error(`Unknown unexpected-header form '${header}'`) - } - }) - } - - // check interim responses - if ('expected_interim_responses' in reqConfig) { - const isSetup = setupCheck(reqConfig, 'expected_interim_responses') - - reqConfig.expected_interim_responses.forEach(([statusCode, headers = []], idx) => { - if (interimResponses[idx] == null) { - assert(isSetup, false, `Interim response ${idx + 1} not received`) - } else { - assert(isSetup, interimResponses[idx][0] === statusCode, `Interim response ${idx + 1} status is ${interimResponses[idx][0]}, not ${statusCode}`) - - const receivedHeaders = interimResponses[idx][1] - headers.forEach(([header, value]) => { - if (typeof header === 'string') { - assert(isSetup, header in receivedHeaders, - `Interim response ${idx + 1} ${header} header not present.`) - } else if (header.length > 2) { - assert(isSetup, header in receivedHeaders, - `Interim response ${idx + 1} ${header} header not present.`) - - const receivedValue = receivedHeaders[header] - assert(isSetup, value === receivedValue, - `Interim response ${idx + 1} header ${header} is ${receivedValue}, should ${value}`) - } else { - console.log('ERROR: Unknown header item in expected_interim_responses', header) - } - }) - } - }) - } - - return response.text().then(makeCheckResponseBody(test, reqConfig, response.status)) -} - -function makeCheckResponseBody (test, reqConfig, statusCode) { - return function checkResponseBody (resBody) { - if ('check_body' in reqConfig && reqConfig.check_body === false) { - return true - } else if ('expected_response_text' in reqConfig) { - if (reqConfig.expected_response_text !== null) { - assert(setupCheck(reqConfig, 'expected_response_text'), - resBody === reqConfig.expected_response_text, - `Response body is "${resBody}", not "${reqConfig.expected_response_text}"`) - } - } else if ('response_body' in reqConfig && reqConfig.response_body !== null) { - assert(true, // response_body is always setup - resBody === reqConfig.response_body, - `Response body is "${resBody}", not "${reqConfig.response_body}"`) - } else if (!defines.noBodyStatus.has(statusCode) && reqConfig.request_method !== 'HEAD') { - const uuid = testUUIDs[test.id] - assert(true, // no_body is always setup - resBody === uuid, - `Response body is "${resBody}", not "${uuid}"`) - } - } -} - -function checkServerRequests (requests, responses, serverState) { - // compare a test's requests array against the server-side serverState - let testIdx = 0 - for (let i = 0; i < requests.length; ++i) { - const expectedValidatingHeaders = [] - const reqConfig = requests[i] - const response = responses[i] - const serverRequest = serverState[testIdx] - const reqNum = i + 1 - const typeSetup = setupCheck(reqConfig, 'expected_type') - if ('expected_type' in reqConfig) { - if (reqConfig.expected_type === 'cached') continue // the server will not see the request - if (reqConfig.expected_type === 'not_cached') { - assert(typeSetup, serverRequest.request_num === reqNum, `Response ${reqNum} comes from cache (${serverRequest.request_num} on server)`) - } - if (reqConfig.expected_type === 'etag_validated') { - expectedValidatingHeaders.push('if-none-match') - } - if (reqConfig.expected_type === 'lm_validated') { - expectedValidatingHeaders.push('if-modified-since') - } - } - testIdx++ // only increment for requests the server sees - expectedValidatingHeaders.forEach(vhdr => { - assert(typeSetup, typeof (serverRequest) !== 'undefined', `request ${reqNum} wasn't sent to server`) - assert(typeSetup, Object.prototype.hasOwnProperty.call(serverRequest.request_headers, vhdr), - `request ${reqNum} doesn't have ${vhdr} header`) - }) - if ('expected_request_headers' in reqConfig) { - const reqPresentSetup = setupCheck(reqConfig, 'expected_request_headers') - reqConfig.expected_request_headers.forEach(header => { - if (typeof header === 'string') { - const headerName = header.toLowerCase() - assert(reqPresentSetup, Object.prototype.hasOwnProperty.call(serverRequest.request_headers, headerName), - `Request ${reqNum} ${header} header not present.`) - } else { - const reqValue = serverRequest.request_headers[header[0].toLowerCase()] - assert(reqPresentSetup, reqValue === header[1], - `Request ${reqNum} header ${header[0]} is "${reqValue}", not "${header[1]}"`) - } - }) - } - if ('expected_request_headers_missing' in reqConfig) { - const reqmPresentSetup = setupCheck(reqConfig, 'expected_request_headers_missing') - reqConfig.expected_request_headers_missing.forEach(header => { - if (typeof header === 'string') { - const headerName = header.toLowerCase() - assert(reqmPresentSetup, !Object.prototype.hasOwnProperty.call(serverRequest.request_headers, headerName), - `Request ${reqNum} ${header} header present.`) - } else { - const reqValue = serverRequest.request_headers[header[0].toLowerCase()] - assert(reqmPresentSetup, reqValue !== header[1], - `Request ${reqNum} header ${header[0]} is "${reqValue}"`) - } - }) - } - if (typeof serverRequest !== 'undefined' && 'response_headers' in serverRequest) { - serverRequest.response_headers.forEach(header => { - if (config.useBrowserCache && defines.forbiddenResponseHeaders.has(header[0].toLowerCase())) { - // browsers prevent reading these headers through the Fetch API so we can't verify them - return - } - if (defines.skipResponseHeaders.has(header[0].toLowerCase())) { - // these just cause spurious failures - return - } - let received = response.headers.get(header[0]) - // XXX: assumes that if a proxy joins headers, it'll separate them with a comma and exactly one space - if (Array.isArray(received)) { - received = received.join(', ') - } - if (Array.isArray(header[1])) { - header[1] = header[1].join(', ') - } - assert(true, // default headers is always setup - received === header[1], - `Response ${reqNum} header ${header[0]} is "${received}", not "${header[1]}"`) - }) - } - if ('expected_method' in reqConfig) { - assert( - setupCheck(reqConfig, 'expected_method'), - serverRequest.request_method === reqConfig.expected_method, - `Request ${reqNum} had method ${serverRequest.request_method}, not ${reqConfig.expected_method}` - ) - } - } -} diff --git a/test/fixtures/cache-tests/test-engine/client/utils.mjs b/test/fixtures/cache-tests/test-engine/client/utils.mjs deleted file mode 100644 index a23f3e9fa63..00000000000 --- a/test/fixtures/cache-tests/test-engine/client/utils.mjs +++ /dev/null @@ -1,132 +0,0 @@ -import * as config from './config.mjs' -import * as utils from '../lib/utils.mjs' -import * as defines from '../lib/defines.mjs' - -export function pause () { - return new Promise(function (resolve, reject) { - setTimeout(() => { - return resolve() - }, 3000) - }) -} - -export function makeTestUrl (uuid, reqConfig) { - let extra = '' - if ('filename' in reqConfig) { - extra += `/${reqConfig.filename}` - } - if ('query_arg' in reqConfig) { - extra += `?${reqConfig.query_arg}` - } - return `${config.baseUrl}/test/${uuid}${extra}` -} - -const uninterestingHeaders = new Set(['date', 'expires', 'last-modified', 'content-length', 'content-type', 'connection', 'content-language', 'vary', 'mime-version']) - -export async function putTestConfig (uuid, requests) { - const init = { - method: 'PUT', - headers: [['content-type', 'application/json']], - body: JSON.stringify(requests) - } - return fetch(`${config.baseUrl}/config/${uuid}`, init) - .then(response => { - if (response.status !== 201) { - let headers = '' - response.headers.forEach((hvalue, hname) => { // for some reason, node-fetch reverses these - if (!uninterestingHeaders.has(hname.toLowerCase())) { - headers += `${hname}: ${hvalue} ` - } - }) - throw new utils.SetupError({ message: `PUT config resulted in ${response.status} ${response.statusText} - ${headers}` }) - } - }) -} - -export async function getServerState (uuid) { - return fetch(`${config.baseUrl}/state/${uuid}`) - .then(response => { - if (response.status === 200) { - return response.text() - } - }).then(text => { - if (text === undefined) return [] - return JSON.parse(text) - }) -} - -export function setupCheck (reqConfig, memberName) { - return reqConfig.setup === true || ('setup_tests' in reqConfig && reqConfig.setup_tests.indexOf(memberName) > -1) -} - -export function logRequest (url, init, reqNum) { - console.log(`${defines.GREEN}=== Client request ${reqNum}${defines.NC}`) - if ('method' in init) { - console.log(` ${init.method} ${url}`) - } else { - console.log(` GET ${url}`) - } - init.headers.forEach(header => { - console.log(` ${header[0]}: ${header[1]}`) - }) - console.log('') -} - -export function logResponse (response, interimResponses, reqNum) { - console.log(`${defines.GREEN}=== Client response ${reqNum}${defines.NC}`) - for (const [statusCode, headers] of interimResponses) { - console.log(` HTTP ${statusCode}`) - for (const [key, value] of Object.entries(headers)) { - console.log(` ${key}: ${value}`) - } - console.log('') - } - console.log(` HTTP ${response.status} ${response.statusText}`) - response.headers.forEach((hvalue, hname) => { // for some reason, node-fetch reverses these - console.log(` ${hname}: ${hvalue}`) - }) - console.log('') -} - -class InterimResponsesCollectingHandler { - #handler - #interimResponses - - constructor (handler, interimResponses) { - this.#handler = handler - this.#interimResponses = interimResponses - } - - onRequestStart (controller, context) { - this.#handler.onRequestStart?.(controller, context) - } - - onRequestUpgrade (controller, statusCode, headers, socket) { - this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket) - } - - onResponseStart (controller, statusCode, headers, statusMessage) { - if (statusCode < 200) this.#interimResponses.push([statusCode, headers]) - this.#handler.onResponseStart?.(controller, statusCode, headers, statusMessage) - } - - onResponseData (controller, data) { - this.#handler.onResponseData?.(controller, data) - } - - onResponseEnd (controller, trailers) { - this.#handler.onResponseEnd?.(controller, trailers) - } - - onResponseError (controller, err) { - this.#handler.onResponseError?.(controller, err) - } -} - -export function interimResponsesCollectingInterceptor (collectInto) { - return (dispatch) => { - return (opts, handler) => { - return dispatch(opts, new InterimResponsesCollectingHandler(handler, collectInto)) - } - } -} diff --git a/test/fixtures/cache-tests/test-engine/export.mjs b/test/fixtures/cache-tests/test-engine/export.mjs deleted file mode 100644 index 27eec3ae05b..00000000000 --- a/test/fixtures/cache-tests/test-engine/export.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import fs from 'fs' - -import Ajv from 'ajv' - -import tests from '../tests/index.mjs' - -if (process.argv[2] === 'validate') { - const ajv = new Ajv() - const schema = JSON.parse(fs.readFileSync('test-engine/lib/testsuite-schema.json', 'utf8')) - const validate = ajv.compile(schema) - const valid = validate(tests) - if (!valid) { - console.log(validate.errors) - process.exit(1) - } -} else { - console.log(JSON.stringify(tests, null, 2)) -} diff --git a/test/fixtures/cache-tests/test-engine/lib/defines.mjs b/test/fixtures/cache-tests/test-engine/lib/defines.mjs deleted file mode 100644 index fae246b8388..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/defines.mjs +++ /dev/null @@ -1,28 +0,0 @@ -export const noBodyStatus = new Set([204, 304]) - -export const dateHeaders = new Set(['date', 'expires', 'last-modified', 'if-modified-since', 'if-unmodified-since']) - -export const locationHeaders = new Set(['location', 'content-location']) - -// https://fetch.spec.whatwg.org/#forbidden-response-header-name -export const forbiddenResponseHeaders = new Set(['set-cookie', 'set-cookie2']) - -// headers to skip when checking response_headers (not expected) -export const skipResponseHeaders = new Set(['date']) - -// colours for console -export const RED = '\x1b[31m' -export const GREEN = '\x1b[32m' -export const BLUE = '\x1b[34m' -export const NC = '\x1b[0m' - -// mime types for server -export const mimeTypes = { - html: 'text/html', - jpeg: 'image/jpeg', - jpg: 'image/jpeg', - png: 'image/png', - js: 'application/javascript', - mjs: 'application/javascript', - css: 'text/css' -} diff --git a/test/fixtures/cache-tests/test-engine/lib/display.mjs b/test/fixtures/cache-tests/test-engine/lib/display.mjs deleted file mode 100644 index 75f14dd949a..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/display.mjs +++ /dev/null @@ -1,153 +0,0 @@ -/* global Blob marked */ - -import '../../asset/marked.min.js' -import { Liquid } from '../../asset/liquid.browser.esm.mjs' -import { modalOpen } from './modal.mjs' - -import { determineTestResult, resultTypes } from './results.mjs' - -const templateEngine = new Liquid({ root: 'test-engine/lib/tpl', extname: '.liquid', cache: true }) -templateEngine.registerFilter('typeof', v => typeof (v)) -templateEngine.registerFilter('toLocaleString', v => v.toLocaleString()) -templateEngine.registerFilter('skipHeaders', v => { - if (v) { - return v.filter(hdr => hdr.length < 3 || hdr[2] !== false) - } else { - return [] - } -}) - -export function downloadTestResults (target, fileName, data, auto) { - const dataBlob = new Blob([JSON.stringify(data, null, 2)], { type: 'text/json' }) - target.setAttribute('href', window.URL.createObjectURL(dataBlob)) - target.setAttribute('download', fileName) - target.style.display = 'inherit' - if (auto) { - target.click() - } -} - -export function renderTestResults (testSuites, testResults, testUUIDs, target, useBrowserCache) { - let totalTests = 0 - let totalPassed = 0 - testSuites.forEach(testSuite => { - const headerElement = document.createElement('h3') - target.appendChild(headerElement) - const headerText = document.createTextNode(testSuite.name) - headerElement.appendChild(headerText) - const listElement = document.createElement('ul') - const resultList = target.appendChild(listElement) - let tests = 0 - let passed = 0 - testSuite.tests.forEach(test => { - if (test.browser_only === true && !useBrowserCache === true) return - if (test.cdn_only === true && useBrowserCache === true) return - if (test.browser_skip === true && useBrowserCache === true) return - test.suiteName = testSuite.name - const testElement = resultList.appendChild(document.createElement('li')) - testElement.appendChild(showTestResult(testSuites, test.id, testResults)) - testElement.appendChild(showTestName(test, testUUIDs[test.id])) - tests++ - if (testResults[test.id] === true) { - passed++ - } - }) - const summaryElement = document.createElement('p') - const suiteSummary = target.appendChild(summaryElement) - suiteSummary.appendChild(document.createTextNode(tests + ' tests, ' + passed + ' passed.')) - totalTests += tests - totalPassed += passed - }) - const totalElement = document.createElement('p') - const totalSummary = target.appendChild(totalElement) - const totalText = document.createTextNode('Total ' + totalTests + ' tests, ' + totalPassed + ' passed.') - totalSummary.appendChild(totalText) -} - -export function showTestName (test, uuid) { - const wrapper = document.createElement('span') - const span = document.createElement('span') - span.setAttribute('class', 'clickhint') - span.innerHTML = marked.parse(test.name).slice(3, -5) - span.addEventListener('click', event => { - copyTextToClipboard(test.id) - showTestDetails(test) - }) - wrapper.appendChild(span) - - if (uuid) { - const uuidLinkElement = document.createElement('a') - uuidLinkElement.appendChild(document.createTextNode('⚙︎')) - uuidLinkElement.setAttribute('class', 'uuid') - uuidLinkElement.addEventListener('click', event => { - copyTextToClipboard(uuid) - }) - uuidLinkElement.title = 'Test UUID (click to copy)' - wrapper.appendChild(uuidLinkElement) - } - return wrapper -} - -export function showKey (element) { - const spans = element.getElementsByClassName('fa') - for (const span of spans) { - const kind = span.getAttribute('data-kind') - const styling = resultTypes[kind] - const contentNode = document.createTextNode(styling[0]) - span.style.color = styling[1] - span.appendChild(contentNode) - } -} - -export function showTestResult (testSuites, testId, testResults) { - const result = testResults[testId] - const resultValue = determineTestResult(testSuites, testId, testResults) - const resultNode = document.createTextNode(` ${resultValue[0]} `) - const span = document.createElement('span') - span.className = 'fa' - span.style.color = resultValue[1] - span.appendChild(resultNode) - if (result && typeof (result[1]) === 'string') { - span.title = result[1] - } - return span -} - -export function showTestDetails (test) { - templateEngine - .renderFile('explain-test', { test }) - .then(result => { - console.log(result) - const html = marked.parse(result) - modalOpen(html) - }) - .catch(err => { - console.log(`Template error: ${err}`) - }) -} - -function copyTextToClipboard (text) { - const textArea = document.createElement('textarea') - textArea.style.position = 'fixed' - textArea.style.top = 0 - textArea.style.left = 0 - textArea.style.width = '2em' - textArea.style.height = '2em' - textArea.style.padding = 0 - textArea.style.border = 'none' - textArea.style.outline = 'none' - textArea.style.boxShadow = 'none' - textArea.style.background = 'transparent' - textArea.value = text - document.body.appendChild(textArea) - textArea.focus() - textArea.select() - try { - const successful = document.execCommand('copy') - const msg = successful ? 'successful' : 'unsuccessful' - console.log(`Copying text "${text}" was ${msg}`) - } catch (err) { - console.log('Unable to copy') - } - document.body.removeChild(textArea) -} diff --git a/test/fixtures/cache-tests/test-engine/lib/header-fixup.mjs b/test/fixtures/cache-tests/test-engine/lib/header-fixup.mjs deleted file mode 100644 index 570e0410578..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/header-fixup.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import { locationHeaders, dateHeaders } from './defines.mjs' -import { httpDate } from './utils.mjs' - -export function fixupHeader (header, respHeaders, reqConfig) { - const headerName = header[0].toLowerCase() - - // Date headers - const serverNow = parseInt(respHeaders['server-now']) - if (dateHeaders.has(headerName) && Number.isInteger(header[1])) { - let format - if ('rfc850date' in reqConfig && reqConfig.rfc850date.includes(headerName)) { - format = 'rfc850' - } - header[1] = httpDate(serverNow, header[1], format) - } - - // Location headers - const baseUrl = respHeaders['server-base-url'] - if (locationHeaders.has(headerName) && reqConfig.magic_locations) { - if (header[1]) { - header[1] = `${baseUrl}/${header[1]}` - } else { - header[1] = `${baseUrl}` - } - } - - return header -} diff --git a/test/fixtures/cache-tests/test-engine/lib/modal.mjs b/test/fixtures/cache-tests/test-engine/lib/modal.mjs deleted file mode 100644 index 76cb1da0366..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/modal.mjs +++ /dev/null @@ -1,27 +0,0 @@ -export function modalOpen (content) { - let modal = document.getElementById('modal') - if (!modal) { - modal = document.createElement('div') - modal.classList.add('modal') - modal.id = 'modal' - } - modal.classList.add('modal-open') - modal.innerHTML = content - const closeButton = document.createElement('button') - const closeText = document.createTextNode('❎') - closeButton.appendChild(closeText) - closeButton.classList.add('modal-exit') - closeButton.addEventListener('click', function (event) { - event.preventDefault() - modal.classList.remove('modal-open') - }) - modal.appendChild(closeButton) - document.body.appendChild(modal) - document.onkeydown = function (evt) { - evt = evt || window.event - if (evt.key === 'Escape' || evt.key === 'Esc') { - modal.classList.remove('modal-open') - document.onkeydown = function () {} - } - } -} diff --git a/test/fixtures/cache-tests/test-engine/lib/results.mjs b/test/fixtures/cache-tests/test-engine/lib/results.mjs deleted file mode 100644 index 236912fba38..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/results.mjs +++ /dev/null @@ -1,73 +0,0 @@ -export const resultTypes = { - untested: ['-', '', '-'], - pass: ['\uf058', '#1aa123', '✅'], - fail: ['\uf057', '#c33131', '⛔️'], - optional_fail: ['\uf05a', '#bbbd15', '⚠️'], - yes: ['\uf055', '#999696', 'Y'], - no: ['\uf056', '#999696', 'N'], - setup_fail: ['\uf059', '#4c61ae', '🔹'], - harness_fail: ['\uf06a', '#4c61ae', '⁉️'], - dependency_fail: ['\uf192', '#b4b2b2', '⚪️'], - retry: ['\uf01e', '#4c61ae', '↻'] -} -const passTypes = [resultTypes.pass, resultTypes.yes] - -export function determineTestResult (testSuites, testId, testResults, honorDependencies = true) { - const test = testLookup(testSuites, testId) - const result = testResults[testId] - if (result === undefined) { - return resultTypes.untested - } - if (honorDependencies && test.depends_on !== undefined) { - for (const dependencyId of test.depends_on) { - if (!passTypes.includes(determineTestResult(testSuites, dependencyId, testResults))) { - return resultTypes.dependency_fail - } - } - } - if (result[0] === 'Setup') { - if (result[1] === 'retry') { - return resultTypes.retry - } else { - return resultTypes.setup_fail - } - } - if (result === false && result[0] !== 'Assertion') { - return resultTypes.harness_fail - } - if (result[0] === 'AbortError') { - return resultTypes.harness_fail - } - if (test.kind === 'required' || test.kind === undefined) { - if (result === true) { - return resultTypes.pass - } else { - return resultTypes.fail - } - } else if (test.kind === 'optimal') { - if (result === true) { - return resultTypes.pass - } else { - return resultTypes.optional_fail - } - } else if (test.kind === 'check') { - if (result === true) { - return resultTypes.yes - } else { - return resultTypes.no - } - } else { - throw new Error(`Unrecognised test kind ${test.kind}`) - } -} - -export function testLookup (testSuites, testId) { - for (const testSuite of testSuites) { - for (const test of testSuite.tests) { - if (test.id === testId) { - return test - } - } - } - throw new Error(`Cannot find test ${testId}`) -} diff --git a/test/fixtures/cache-tests/test-engine/lib/summary.mjs b/test/fixtures/cache-tests/test-engine/lib/summary.mjs deleted file mode 100644 index f9cd2f64d53..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/summary.mjs +++ /dev/null @@ -1,178 +0,0 @@ -/* global fetch marked */ - -import '../../asset/marked.min.js' -import * as display from './display.mjs' -import { testLookup } from './results.mjs' - -export function loadResults (index) { - return Promise.all(index.map(item => - fetch(`results/${item.file}`) - .then(response => { - return response.json() - }) - .then(results => { - item.results = results - return item - } - )) - ) -} - -export function showResults (target, testSuites, results, testIds, suiteIds) { - const isDefault = testIds.length === 0 && suiteIds.length === 0 - testSuites.forEach(testSuite => { - const selectedTests = [] - const suiteTestIds = [] - testSuite.tests.forEach(test => { - if (isDefault || suiteIds.includes(testSuite.id)) { - selectedTests.push(test) - suiteTestIds.push(test.id) - } - if (isDefault === 0 || testIds.includes(test.id)) { - if (!suiteTestIds.includes(test.id)) { - selectedTests.push(test) - } - } - }) - if (selectedTests.length) { - showHeader(testSuite, results).forEach(row => { - target.appendChild(row) - }) - selectedTests.forEach(test => { - const result = showTest(testSuites, test.id, results) - if (target.childElementCount % 2) { - result.setAttribute('class', 'shade') - } - target.appendChild(result) - }) - } - }) -} - -export function showToC (target, testSuites) { - testSuites.forEach(testSuite => { - const suiteLink = document.createElement('a') - suiteLink.href = '#' + testSuite.id - suiteLink.appendChild(document.createTextNode(testSuite.name)) - const suiteLi = document.createElement('li') - suiteLi.appendChild(suiteLink) - target.appendChild(suiteLi) - }) -} - -function showHeader (testSuite, results) { - const rows = [] - const numCols = results.length + 2 - const blankRow = tableRow() - blankRow.appendChild(emptyCell(numCols)) - rows.push(blankRow) - const headerRow = tableRow() - headerRow.appendChild(tableCell('th', '\xa0', 'name category')) - const headerLink = document.createElement('a') - headerLink.href = '#' + testSuite.id - headerLink.appendChild(document.createTextNode(testSuite.name)) - const firstHeader = tableCell('th', headerLink, 'name category') - firstHeader.id = testSuite.id - headerRow.appendChild(firstHeader) - results.forEach(implementation => { - headerRow.appendChild(tableCell('th', implementation.name, 'category', implementation.version, implementation.link)) - }) - rows.push(headerRow) - if (testSuite.description !== undefined) { - const descriptionRow = tableRow() - const drCells = emptyCell(numCols) - drCells.innerHTML = marked.parse(testSuite.description).slice(3, -5) - descriptionRow.appendChild(drCells) - rows.push(descriptionRow) - } - return rows -} - -function showTest (testSuites, testId, results) { - const test = testLookup(testSuites, testId) - const testRow = tableRow() - testRow.appendChild(tableCell('td', testSelector(test.id))) - testRow.appendChild(tableCell('th', display.showTestName(test), 'name')) - results.forEach(implementation => { - testRow.appendChild( - tableCell('th', display.showTestResult(testSuites, test.id, implementation.results))) - }) - return testRow -} - -function tableRow (CssClass) { - const rowElement = document.createElement('tr') - if (CssClass) { - rowElement.setAttribute('class', CssClass) - } - return rowElement -} - -function tableCell (cellType, content, CssClass, hint, link, colspan) { - const cellElement = document.createElement(cellType) - if (CssClass) { - cellElement.setAttribute('class', CssClass) - } - if (colspan) { - cellElement.colSpan = colspan - } - let contentNode - if (typeof (content) === 'string') { - contentNode = document.createTextNode(content) - } else { - contentNode = content - } - if (link) { - const linkElement = document.createElement('a') - linkElement.setAttribute('href', link) - linkElement.appendChild(contentNode) - cellElement.appendChild(linkElement) - } else { - cellElement.appendChild(contentNode) - } - if (hint) { - cellElement.title = hint - } - return cellElement -} - -function testSelector (testId) { - const checkbox = document.createElement('input') - checkbox.type = 'checkbox' - checkbox.name = 'id' - checkbox.value = testId - checkbox.style.display = 'none' - checkbox.setAttribute('class', 'select') - return checkbox -} - -export function selectClickListen () { - const select = document.getElementById('select') - select.addEventListener('click', selectClick, { - once: true - }) -} - -function selectClick () { - const selectBoxes = document.getElementsByClassName('select') - for (const selectBox of selectBoxes) { - selectBox.style.display = 'inherit' - } - const submit = document.createElement('input') - submit.type = 'submit' - submit.value = 'Show only selected tests' - const select = document.getElementById('select') - select.replaceWith(submit) -} - -export function selectClearShow () { - const clear = document.createElement('a') - clear.href = '?' - clear.appendChild(document.createTextNode('Clear selections')) - const select = document.getElementById('select') - select.replaceWith(clear) -} - -function emptyCell (numCols = 1) { - return tableCell('td', '\xa0', undefined, undefined, undefined, numCols) -} diff --git a/test/fixtures/cache-tests/test-engine/lib/testsuite-schema.json b/test/fixtures/cache-tests/test-engine/lib/testsuite-schema.json deleted file mode 100644 index 1890c8da543..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/testsuite-schema.json +++ /dev/null @@ -1,548 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://cache-tests.fyi/testsuite-schema.json", - "title": "Cache Tests", - "description": "A list of test suites", - "type": "array", - "items": { - "description": "A test suite", - "type": "object", - "required": [ "name", "id", "tests"], - "additionalProperties": false, - "properties": { - "name": { - "description": "The name of the suite", - "type": "string" - }, - "id": { - "description": "A unique identifier for the suite", - "type": "string" - }, - "description": { - "description": "A Markdown description of the suite", - "type": "string" - }, - "spec_anchors": { - "description": "Anchors in the HTTP caching spec that this suite applies to", - "type": "array", - "items": { - "type": "string" - } - }, - "tests": { - "description": "An array of tests in the suite", - "type": "array", - "items": { - "description": "A test", - "type": "object", - "additionalProperties": false, - "required": ["name", "id", "requests"], - "properties": { - "name": { - "description": "The test name; can contain Markdown.", - "type": "string" - }, - "id": { - "$ref": "#/definitions/test-id" - }, - "description": { - "description": "A longer, Markdown description of the test", - "type": "string" - }, - "kind": { - "description": "The kind of test", - "type": "string", - "enum": ["required", "optimal", "check"] - }, - "spec_anchors": { - "description": "Anchors in the HTTP caching spec that this test applies to", - "type": "array", - "items": { - "type": "string" - } - }, - "requests": { - "description": "An array of requests", - "type": "array", - "items": { - "description": "A request to send in the test", - "type": "object", - "additionalProperties": false, - "properties": { - "request_method": { - "description": "the HTTP method to be used", - "type": "string" - }, - "request_headers": { - "description": "headers to emit in the request", - "type": "array", - "items": { - "type": "array", - "additionalItems": false, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "$ref": "#/definitions/magic-field-value" - } - ] - } - }, - "request_body": { - "description": "the HTTP request body to be used", - "type": "string" - }, - "query_arg": { - "description": "query arguments to add to the URL", - "type": "string" - }, - "filename": { - "description": "filename to add to the URL", - "type": "string" - }, - "mode": { - "description": "the mode value to pass to fetch()", - "type": "string", - "enum": ["same-origin", "no-cors", "navigate", "websocket"] - }, - "credentials": { - "description": "the credentials value to pass to fetch()", - "type": "string", - "enum": ["omit", "same-origin", "include"] - }, - "cache": { - "description": "the cache value to pass to fetch()", - "type": "string", - "enum": ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"] - }, - "redirect": { - "description": "the redirect value to pass to fetch()", - "type": "string", - "enum": ["follow", "error", "manual"] - }, - "pause_after": { - "description": "Whether to pause for three seconds after the request completes", - "type": "boolean" - }, - "disconnect": { - "description": "Whether to disconnect the client when receiving thsi request", - "type": "boolean" - }, - "magic_locations": { - "description": "Whether to rewrite Location and Content-Location to full URLs", - "type": "boolean" - }, - "interim_responses": { - "description": "Interim responses to send before the final response", - "type": "array", - "items": { - "oneOf": [ - { - "description": "Status code only", - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": [ - { - "$ref": "#/definitions/status-code" - } - ] - }, - { - "description": "Status code and headers", - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": [ - { - "$ref": "#/definitions/status-code" - }, - { - "description": "Interim response headers", - "type": "array", - "items": { - "type": "array", - "additionalItems": false, - "minItems": 2, - "maxItems": 2, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "$ref": "#/definitions/magic-field-value" - } - ] - } - } - ] - } - ] - } - }, - "expected_interim_responses": { - "description": "Interim responses expected to be received by the client", - "type": "array", - "items": { - "oneOf": [ - { - "description": "Status code only", - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": [ - { - "$ref": "#/definitions/status-code" - } - ] - }, - { - "description": "Status code and headers", - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": [ - { - "$ref": "#/definitions/status-code" - }, - { - "description": "Expected interim response headers", - "type": "array", - "items": { - "type": "array", - "additionalItems": false, - "minItems": 2, - "maxItems": 2, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "$ref": "#/definitions/magic-field-value" - } - ] - } - } - ] - } - ] - } - }, - "magic_ims": { - "description": "Whether to rewrite If-Modified-Since to a delta from the previous Last-Modified", - "type": "boolean" - }, - "rfc850date": { - "description": "Header names to use RFC850 format on when converting dates", - "type": "array", - "items": [ - { - "$ref": "#/definitions/date-headers" - } - ] - }, - "response_status": { - "description": "HTTP status code and phrase to return from origin", - "type": "array", - "items": [ - { - "$ref": "#/definitions/status-code" - }, - { - "description": "status phrase", - "type": "string" - } - ] - }, - "response_headers": { - "description": "Response header fields to be returned from origin", - "type": "array", - "items": { - "anyOf": [ - { - "description": "name and value", - "type": "array", - "additionalItems": false, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "oneOf": [ - { "type": "string" }, - { "type": "integer" } - ] - } - ] - }, - { - "description": "name and value with control over checking", - "type": "array", - "additionalItems": false, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "$ref": "#/definitions/magic-field-value" - }, - { - "type": "boolean" - } - ] - } - ] - } - }, - "response_body": { - "description": "Response body to be returned from origin; defaults to the test identifier", - "$ref": "#/definitions/response-or-null" - }, - "check_body": { - "description": "Whether to check the response body on the client", - "type": "boolean" - }, - "expected_type": { - "description": "What the test result is expected to be", - "type": "string", - "enum": ["cached", "not_cached", "lm_validated", "etag_validated"] - }, - "expected_method": { - "description": "Expected request method received by the server", - "type": "string" - }, - "expected_status": { - "description": "Expected response status received by the client", - "anyOf": [ - { - "$ref": "#/definitions/status-code" - }, - { - "type": "null" - } - ] - }, - "expected_request_headers": { - "description": "Request headers to check for on the server", - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/field-name" - }, - { - "description": "name and value", - "type": "array", - "additionalItems": false, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "description": "field value", - "type": "string" - } - ] - } - ] - } - }, - "response_pause": { - "description": "Pause the response body by the server", - "type": "integer" - }, - "expected_request_headers_missing": { - "description": "Request headers to check for absence on the server", - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/field-name" - }, - { - "description": "name and value", - "type": "array", - "additionalItems": false, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "description": "field value", - "type": "string" - } - ] - } - ] - } - }, - "expected_response_headers": { - "description": "Response headers to check for on the client", - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/field-name" - }, - { - "description": "name and value", - "type": "array", - "additionalItems": false, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "$ref": "#/definitions/magic-field-value" - } - ] - }, - { - "description": "check two headers have the same value", - "type": "array", - "additionalItems": false, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "const": "=" - }, - { - "description": "field name to check against", - "type": "string" - } - ] - }, - { - "description": "header value is greater than an integer", - "type": "array", - "additionalItems": false, - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "const": ">" - }, - { - "description": "integer to check against", - "type": "integer" - } - ] - } - ] - } - }, - "expected_response_headers_missing": { - "description": "Response headers to check are missing on the client", - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/field-name" - }, - { - "description": "name and value", - "type": "array", - "items": [ - { - "$ref": "#/definitions/field-name" - }, - { - "description": "field value substring", - "type": "string" - } - ] - } - ] - } - }, - "expected_response_text": { - "description": "Expected response body received by the client", - "$ref": "#/definitions/response-or-null" - }, - "setup": { - "description": "Whether this is a setup request; failures don't mean the actual test failed", - "type": "boolean" - }, - "setup_tests": { - "description": "List of checks that are considered setup", - "type": "array", - "items": { - "type": "string", - "enum": ["expected_type", "expected_method", "expected_status", "expected_response_headers", "expected_response_text", "expected_request_headers"] - } - } - } - } - }, - "browser_only": { - "description": "Whether the test will only run on browsers", - "type": "boolean" - }, - "cdn_only": { - "description": "Whether the test will only run on CDN caches", - "type": "boolean" - }, - "browser_skip": { - "description": "Whether the test will skip browsers", - "type": "boolean" - }, - "depends_on": { - "description": "List of Test IDs that this test depends on", - "type": "array", - "items": { - "$ref": "#/definitions/test-id" - } - } - } - } - } - } - }, - "definitions": { - "field-name": { - "description": "HTTP header field name", - "type": "string", - "pattern": "^[a-zA-Z0-9-_]+$" - }, - "magic-field-value": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "test-id": { - "description": "A short identifer for a test", - "type": "string" - }, - "response-or-null": { - "oneOf": [ - { - "description": "The text of the response", - "type": "string" - }, - { - "description": "Do not check the response", - "type": "null" - } - ] - }, - "status-code": { - "description": "HTTP response status code", - "type": "integer", - "minimum": 100, - "maximum": 599 - }, - "date-headers": { - "type": "string", - "enum": ["date", "if-modified-since", "last-modified", "expires"] - } - } -} diff --git a/test/fixtures/cache-tests/test-engine/lib/tpl/checks.liquid b/test/fixtures/cache-tests/test-engine/lib/tpl/checks.liquid deleted file mode 100644 index 0193a06367d..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/tpl/checks.liquid +++ /dev/null @@ -1,59 +0,0 @@ - -{%- if request.setup -%} - {%- assign setup_prop = '' -%} -{%- else -%} - {%- assign setup_prop = ' _(Failure will be considered a test setup issue)_' -%} -{%- endif %} - -### The following checks will be performed: - -{%- if request.interim_responses -%} -{%- for interim_response in request.interim_responses %} -- The client will check that an interim response with the `{{ interim_response[0] }}` status code{% if interim_response[1] %} and the following headers{% endif %} is received. -{%- render 'header-list' with interim_response[1] as headers %} -{%- endfor -%} -{%- endif -%} - -{%- if request.expected_type %} -- The client will check that this response {% case request.expected_type %}{% when "cached" %}is cached{% when "not_cached" %}is not cached{% when "lm_validated" %}is validated using `Last-Modified`{% when "etag_validated" %}is validated using `ETag`{% endcase %} {% if test.setup_tests contains "expected_type" %}{{ setup_prop }}{% endif %}{% endif -%} - -{%- if request.expected_method %} -- The server will check that the request method is `{{ request.expected_method }}`.{% endif -%} - -{%- if request.expected_request_headers.size > 0 %} -- The server will check that the following request headers (and values, when specified) are present{% if test.setup_tests contains "expected_request_headers" %}{{ setup_prop }}{% endif %}: -{%- render 'header-list' with request.expected_request_headers as headers %}{% endif -%} - -{%- if request.expected_request_headers_missing.size > 0 %} -- The server will check that the following request headers (and values, when specified) are absent{% if test.setup_tests contains "expected_request_headers_missing" %}{{ setup_prop }}{% endif %}: -{%- render 'header-list' with request.expected_request_headers_missing as headers %}{% endif -%} - -{%- if request.expected_status %} -- The client will check that the status code is `{{ request.expected_status }}` {% if test.setup_tests contains "expected_status" %}{{ setup_prop }}{% endif %} -{%- elsif request.response_status %} -- The client will check that the status code is `{{ request.response_status | join: " " }}`{{ setup_prop }} -{%- else %} -- The client will check that the status code is `200 OK`{{ setup_prop }} -{%- endif -%} - -{%- assign response_headers = request.response_headers | skipHeaders -%} -{%- if request.expected_response_headers.size > 0 or response_headers.size > 0 %} -- The client will check that the following response headers (and values, when specified) are present{% if test.setup_tests contains "expected_response_headers" %}{{ setup_prop }}{% endif -%}: -{%- render 'header-list' with request.expected_response_headers as headers -%} -{%- render 'header-list' with response_headers as headers %}{% endif -%} - -{%- if request.expected_response_headers_missing.size > 0 %} -- The client will check that the following response headers (and values, when specified) are missing: -{%- render 'header-list' with request.expected_response_headers_missing as headers %}{% endif -%} - -{%- if request.check_body != false %} -- The client will check the body -{%- if request.expected_response text -%} -, expecting: `{{ request.expected_response_text }}` {% if test.setup_tests contains "expected_response_text" %}{{ setup_prop }}{% endif %} -{%- else -%} -, expecting the generated response body. -{%- endif -%} -{%- endif -%} - - - diff --git a/test/fixtures/cache-tests/test-engine/lib/tpl/explain-test.liquid b/test/fixtures/cache-tests/test-engine/lib/tpl/explain-test.liquid deleted file mode 100644 index c791ab023c6..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/tpl/explain-test.liquid +++ /dev/null @@ -1,98 +0,0 @@ -# {{ test.name }} - -Test ID: `{{ test.id }}` - -{% case test.kind %} -{%- when "optimal" -%}This is an optional test for cache efficiency -{%- when "check" -%}This is an informational check -{%- else -%}This is a conformance test -{%- endcase -%} -{%- if test.browser_only %} run on browsers only{% endif -%} -{%- if test.cdn_only %} run on CDN caches only{% endif -%} -{%- if test.browser_skip %} not run on browsers{% endif -%} -. - -{%- if test.depends_on %} It depends on the following test IDs: -{%- for dependant in test.depends_on %} -- `{{ dependant }}` -{%- endfor %}{% endif %} - -{% for request in test.requests -%} -## Request {{ forloop.index }} - -{%- if request.setup == true %} - -_This is a setup request; if it fails, we can't perform the test._ -{%- endif -%} - -{%- if request.disconnect == true %} - -The server will disconnect the client when receiving this request. -{%- endif -%} - - -{%- if request.mode or request.credentials or request.cache or request.redirect %} - -### Fetch [init](https://fetch.spec.whatwg.org/#requestinit): -{%- if request.mode %} -- Mode: {{ request.mode }} -{%- endif -%} -{%- if request.credentials %} -- Credentials: {{ request.credentials }} -{%- endif -%} -{%- if request.cache %} -- Cache: {{ request.cache }} -{%- endif -%} -{%- if request.redirect %} -- Redirect: {{ request.redirect }} -{%- endif -%} -{%- endif %} - -### The client sends a request containing: -~~~ -{{ request.request_method | default: 'GET' }} [generated test URL]{% if request.filename %}/{% endif %}{{ request.filename }}{% if request.query_arg %}?{% endif %}{{ request.query_arg }} {{ magic_locations }} -{% for header in request.request_headers %}{% render 'header-magic' with header as header %} -{% endfor %} -{{ request.request_body }} -~~~ - -{%- if request.response_pause %} - -The server will pause for {{ request.response_pause }} seconds before responding.{% endif -%} - -{%- if request.response_status or request.response_headers or request.response_body %} - -### The server sends {% if request.interim_responses %}responses{% else %}a response{% endif %} containing: - -~~~ -{% if request.interim_responses -%} -{% for interim_response in request.interim_responses -%} -HTTP/1.1 {{ interim_response[0] }} -{% for header in interim_response[1] %}{% render 'header-magic' with header as header %} -{% endfor %} -{% endfor -%} -{%- endif -%} -{% if request.expected_type == "lm_validated" or request.expected_type = "etag_validated" -%} -HTTP/1.1 304 Not Modified -{%- else -%} -HTTP/1.1 {{ request.response_status[0] | default: 200 }} {{ request.response_status[1] | default: "OK" }} -{%- endif %} -{% for header in request.response_headers %}{% render 'header-magic' with header as header %} -{% endfor %} -{{ request.response_body | default: '[generated response body]' }} -~~~{% endif -%} - -{%- if request.rfc850date %} -All instances of the following headers will be send and checked for being in RFC850 date format: -{% for header in request.rfc850date %} - - `{{ header }}` -{% endfor %} -{% endif -%} - -{% render 'checks' with request as request %} - -{%- if request.pause_after == true %} - -The client will pause for three seconds after this request.{% endif %} - -{% endfor %} diff --git a/test/fixtures/cache-tests/test-engine/lib/tpl/header-list.liquid b/test/fixtures/cache-tests/test-engine/lib/tpl/header-list.liquid deleted file mode 100644 index 03acc22b86b..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/tpl/header-list.liquid +++ /dev/null @@ -1,16 +0,0 @@ -{%- for header in headers %} - - {% if header.first -%} - {%- if header.size == 3 -%} - {%- case header[1] -%} - {%- when ">" -%} - `{{ header[0] }}` is greater than `{{ header[2] }}` - {%- when "=" -%} - `{{ header[0] }}` has the same value as `{{ header[2] }}` - {%- endcase -%} - {%- else -%} - `{% render 'header-magic' with header as header %}` - {%- endif -%} - {%- else -%} - `{{ header }}` - {%- endif -%} -{% endfor -%} diff --git a/test/fixtures/cache-tests/test-engine/lib/tpl/header-magic.liquid b/test/fixtures/cache-tests/test-engine/lib/tpl/header-magic.liquid deleted file mode 100644 index 843c3a43b70..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/tpl/header-magic.liquid +++ /dev/null @@ -1,6 +0,0 @@ -{%- assign mytype = header[1] | typeof -%} -{{ header[0] }}: {% if mytype == 'number' -%} - [ {{ header[1] | toLocaleString }} seconds delta ] -{%- else -%} - {{ header[1] }} -{%- endif -%} diff --git a/test/fixtures/cache-tests/test-engine/lib/utils.mjs b/test/fixtures/cache-tests/test-engine/lib/utils.mjs deleted file mode 100644 index cc071adca26..00000000000 --- a/test/fixtures/cache-tests/test-engine/lib/utils.mjs +++ /dev/null @@ -1,89 +0,0 @@ -export function AssertionError (options) { - this.name = 'Assertion' - this.message = options.message -} - -export function SetupError (options) { - this.name = 'Setup' - this.message = options.message -} - -export function assert (isSetup, expr, message) { - if (expr) return - if (isSetup) { - throw new SetupError({ message }) - } else { - throw new AssertionError({ message }) - } -} - -export function token () { - return [toHex(randInt(32), 8), - toHex(randInt(16), 4), - toHex(0x4000 | randInt(12), 4), - toHex(0x8000 | randInt(14), 4), - toHex(randInt(48), 12)].join('-') -} - -function randInt (bits) { - if (bits < 1 || bits > 53) { - throw new TypeError() - } else { - if (bits >= 1 && bits <= 30) { - return 0 | ((1 << bits) * Math.random()) - } else { - const high = (0 | ((1 << (bits - 30)) * Math.random())) * (1 << 30) - const low = 0 | ((1 << 30) * Math.random()) - return high + low - } - } -} - -function toHex (x, length) { - let rv = x.toString(16) - while (rv.length < length) { - rv = '0' + rv - } - return rv -} - -const rfc850day = { - 0: 'Sunday', - 1: 'Monday', - 2: 'Tuesday', - 3: 'Wednesday', - 4: 'Thursday', - 5: 'Friday', - 6: 'Saturday' -} - -const rfc850month = { - 0: 'Jan', - 1: 'Feb', - 2: 'Mar', - 3: 'Apr', - 4: 'May', - 5: 'Jun', - 6: 'Jul', - 7: 'Aug', - 8: 'Sep', - 9: 'Oct', - 10: 'Nov', - 11: 'Dec' -} - -export function httpDate (now, deltaSecs, format) { - const instant = new Date(now + (deltaSecs * 1000)) - if (format && format === 'rfc850') { - const day = rfc850day[instant.getUTCDay()] - const date = instant.getUTCDate().toString().padStart(2, '0') - const month = rfc850month[instant.getUTCMonth()] - const year = instant.getUTCFullYear().toString().slice(2) - const hours = instant.getUTCHours().toString().padStart(2, '0') - const mins = instant.getUTCMinutes().toString().padStart(2, '0') - const secs = instant.getUTCSeconds().toString().padStart(2, '0') - // Sunday, 06-Nov-94 08:49:37 GMT - return `${day}, ${date}-${month}-${year} ${hours}:${mins}:${secs} GMT` - } - return instant.toGMTString() -} diff --git a/test/fixtures/cache-tests/test-engine/server/handle-config.mjs b/test/fixtures/cache-tests/test-engine/server/handle-config.mjs deleted file mode 100644 index 80c7492d13d..00000000000 --- a/test/fixtures/cache-tests/test-engine/server/handle-config.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import { sendResponse, configs, setConfig } from './utils.mjs' - -export default function handleConfig (pathSegs, request, response) { - const uuid = pathSegs[0] - if (request.method !== 'PUT') { - sendResponse(response, 405, `${request.method} request to config for ${uuid}`) - return - } - if (configs.has(uuid)) { - sendResponse(response, 409, `Config already exists for ${uuid}`) - return - } - let body = '' - request.on('data', chunk => { - body += chunk - }) - request.on('end', () => { - setConfig(uuid, JSON.parse(body)) - response.statusCode = 201 - response.end('OK') - }) -} diff --git a/test/fixtures/cache-tests/test-engine/server/handle-file.mjs b/test/fixtures/cache-tests/test-engine/server/handle-file.mjs deleted file mode 100644 index a92a9dd94cc..00000000000 --- a/test/fixtures/cache-tests/test-engine/server/handle-file.mjs +++ /dev/null @@ -1,24 +0,0 @@ -import fs from 'fs' -import path from 'path' -import process from 'process' - -import { sendResponse } from './utils.mjs' -import { mimeTypes } from '../lib/defines.mjs' - -export default function handleFile (url, request, response) { - let urlPath = path.normalize(url.pathname) - if (urlPath === '/') urlPath = '/index.html' - const filename = path.join(process.cwd(), urlPath) - let stat - try { - stat = fs.statSync(filename) - } catch {} - if (!stat || !stat.isFile()) { - sendResponse(response, 404, `${urlPath} Not Found`) - return - } - const mimeType = mimeTypes[path.extname(filename).split('.')[1]] || 'application/octet-stream' - const fileStream = fs.createReadStream(filename) - response.writeHead(200, { 'Content-Type': mimeType }) - fileStream.pipe(response) -} diff --git a/test/fixtures/cache-tests/test-engine/server/handle-state.mjs b/test/fixtures/cache-tests/test-engine/server/handle-state.mjs deleted file mode 100644 index 43b22ce88fe..00000000000 --- a/test/fixtures/cache-tests/test-engine/server/handle-state.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import { sendResponse, stash } from './utils.mjs' - -export default function handleState (pathSegs, request, response) { - const uuid = pathSegs[0] - const state = stash.get(uuid) - if (state === undefined) { - sendResponse(response, 404, `State not found for ${uuid}`) - return - } - response.setHeader('Content-Type', 'text/plain') - response.end(JSON.stringify(state)) -} diff --git a/test/fixtures/cache-tests/test-engine/server/handle-test.mjs b/test/fixtures/cache-tests/test-engine/server/handle-test.mjs deleted file mode 100644 index 808020469eb..00000000000 --- a/test/fixtures/cache-tests/test-engine/server/handle-test.mjs +++ /dev/null @@ -1,129 +0,0 @@ -import { noBodyStatus } from '../lib/defines.mjs' -import { fixupHeader } from '../lib/header-fixup.mjs' -import { sendResponse, getHeader, configs, stash, setStash, logRequest, logResponse } from './utils.mjs' - -export default function handleTest (pathSegs, request, response) { - // identify the desired configuration for this request - const uuid = pathSegs[0] - if (!uuid) { - sendResponse(response, 404, `Config Not Found for ${uuid}`) - return - } - const requests = configs.get(uuid) - if (!requests) { - sendResponse(response, 409, `Requests not found for ${uuid}`) - return - } - - const serverState = stash.get(uuid) || [] - const srvReqNum = serverState.length + 1 - const cliReqNum = parseInt(request.headers['req-num']) - const reqNum = cliReqNum || srvReqNum - const reqConfig = requests[reqNum - 1] - - if (!reqConfig) { - sendResponse(response, 409, `${requests[0].id} config not found for request ${srvReqNum} (anticipating ${requests.length})`) - return - } - if (reqConfig.dump) logRequest(request, srvReqNum) - - // response_pause - if ('response_pause' in reqConfig) { - setTimeout(continueHandleTest, reqConfig.response_pause * 1000, uuid, request, response, requests, serverState) - } else { - continueHandleTest(uuid, request, response, requests, serverState) - } -} - -function continueHandleTest (uuid, request, response, requests, serverState) { - const srvReqNum = serverState.length + 1 - const cliReqNum = parseInt(request.headers['req-num']) - const reqNum = cliReqNum || srvReqNum - const reqConfig = requests[reqNum - 1] - const previousConfig = requests[reqNum - 2] - const now = Date.now() - - const interimResponses = reqConfig.interim_responses || [] - for (const [status, headers = []] of interimResponses) { - if (status === 102) { - response.writeProcessing() - } else if (status === 103) { - response.writeEarlyHints(Object.fromEntries(headers)) - } else { - console.log(`ERROR: Sending ${status} is not yet supported`) - } - } - - // Determine what the response status should be - let httpStatus = reqConfig.response_status || [200, 'OK'] - if ('expected_type' in reqConfig && reqConfig.expected_type.endsWith('validated')) { - const previousLm = getHeader(previousConfig.response_headers, 'Last-Modified') - if (previousLm && request.headers['if-modified-since'] === previousLm) { - httpStatus = [304, 'Not Modified'] - } - const previousEtag = getHeader(previousConfig.response_headers, 'ETag') - if (previousEtag && request.headers['if-none-match'] === previousEtag) { - httpStatus = [304, 'Not Modified'] - } - if (httpStatus[0] !== 304) { - httpStatus = [999, '304 Not Generated'] - } - } - response.statusCode = httpStatus[0] - response.statusPhrase = httpStatus[1] - - // header manipulation - const responseHeaders = reqConfig.response_headers || [] - const savedHeaders = new Map() - response.setHeader('Server-Base-Url', request.url) - response.setHeader('Server-Request-Count', srvReqNum) - response.setHeader('Client-Request-Count', cliReqNum) - response.setHeader('Server-Now', now, 0) - responseHeaders.forEach(header => { - header = fixupHeader(header, response.getHeaders(), reqConfig) - if (response.hasHeader(header[0])) { - const currentVal = response.getHeader(header[0]) - if (typeof currentVal === 'string') { - response.setHeader(header[0], [currentVal, header[1]]) - } else if (Array.isArray(currentVal)) { - response.setHeader(header[0], currentVal.concat(header[1])) - } else { - console.log(`ERROR: Unanticipated header type of ${typeof currentVal} for ${header[0]}`) - } - } else { - response.setHeader(header[0], header[1]) - } - if (header.length < 3 || header[2] === true) { - savedHeaders.set(header[0], response.getHeader(header[0])) - } - }) - - if (!response.hasHeader('content-type')) { - response.setHeader('Content-Type', 'text/plain') - } - - // stash information about this request for the client - serverState.push({ - request_num: cliReqNum, - request_method: request.method, - request_headers: request.headers, - response_headers: Array.from(savedHeaders.entries()) - }) - response.setHeader('Request-Numbers', serverState.map(item => item.request_num).join(' ')) - setStash(uuid, serverState) - - // Response body generation - if ('disconnect' in reqConfig && reqConfig.disconnect) { - // disconnect now because we want the state - response.socket.destroy() - response = 'disconnect' - } else if (noBodyStatus.has(response.statusCode)) { - response.end() - } else { - const content = reqConfig.response_body || uuid - response.end(content) - } - - // logging - if (reqConfig.dump) logResponse(response, interimResponses, srvReqNum) -} diff --git a/test/fixtures/cache-tests/test-engine/server/server.mjs b/test/fixtures/cache-tests/test-engine/server/server.mjs deleted file mode 100644 index 58f098ba77f..00000000000 --- a/test/fixtures/cache-tests/test-engine/server/server.mjs +++ /dev/null @@ -1,54 +0,0 @@ -/* global URL */ - -import fs from 'fs' -import http from 'http' -import https from 'https' -import process from 'process' - -import handleConfig from './handle-config.mjs' -import handleFile from './handle-file.mjs' -import handleState from './handle-state.mjs' -import handleTest from './handle-test.mjs' - -function handleMain (request, response) { - const url = new URL(request.url, baseUrl) - const pathSegs = url.pathname.split('/') - pathSegs.shift() - const dispatch = pathSegs.shift() - if (dispatch === 'config') { - handleConfig(pathSegs, request, response) - } else if (dispatch === 'test') { - handleTest(pathSegs, request, response) - } else if (dispatch === 'state') { - handleState(pathSegs, request, response) - } else { - handleFile(url, request, response) - } -} - -const protocol = process.env.npm_config_protocol || process.env.npm_package_config_protocol -const port = process.env.npm_config_port || process.env.npm_package_config_port -const baseUrl = `${protocol}://localhost:${port}/` -const pidfile = process.env.npm_config_pidfile || process.env.npm_package_config_pidfile - -fs.writeFile(pidfile, process.pid.toString(), 'ascii', function (err) { - if (err) { console.log(`PID file write error: ${err.message}`) } -}) - -let server -if (protocol.toLowerCase() === 'https') { - const options = { - key: fs.readFileSync(process.env.npm_config_keyfile), - cert: fs.readFileSync(process.env.npm_config_certfile) - } - server = https.createServer(options, handleMain) -} else { - server = http.createServer(handleMain) -} -server.on('listening', () => { - const host = (server.address().family === 'IPv6') - ? `[${server.address().address}]` - : server.address().address - console.log(`Listening on ${protocol.toLowerCase()}://${host}:${server.address().port}/`) -}) -server.listen(port) diff --git a/test/fixtures/cache-tests/test-engine/server/utils.mjs b/test/fixtures/cache-tests/test-engine/server/utils.mjs deleted file mode 100644 index ce496a86116..00000000000 --- a/test/fixtures/cache-tests/test-engine/server/utils.mjs +++ /dev/null @@ -1,61 +0,0 @@ -import { BLUE, NC } from '../lib/defines.mjs' - -export function sendResponse (response, statusCode, message) { - console.log(`SERVER WARNING: ${message}`) - response.writeHead(statusCode, { 'Content-Type': 'text/plain' }) - response.write(`${message}\n`) - response.end() -} - -export function getHeader (headers, headerName) { - let result - headers.forEach(header => { - if (header[0].toLowerCase() === headerName.toLowerCase()) { - result = header[1] - } - }) - return result -} - -// stash for server state -export const stash = new Map() - -export function setStash (key, value) { - stash.set(key, value) -} - -// configurations -export const configs = new Map() - -export function setConfig (key, value) { - configs.set(key, value) -} - -export function logRequest (request, reqNum) { - console.log(`${BLUE}=== Server request ${reqNum}${NC}`) - console.log(` ${request.method} ${request.url}`) - for (const [key, value] of Object.entries(request.headers)) { - console.log(` ${key}: ${value}`) - } - console.log('') -} - -export function logResponse (response, interimResponses, resNum) { - console.log(`${BLUE}=== Server response ${resNum}${NC}`) - if (response === 'disconnect') { - console.log(' [ server disconnect ]') - } else { - for (const [statusCode, headers] of interimResponses) { - console.log(` HTTP ${statusCode}`) - for (const [key, value] of headers) { - console.log(` ${key}: ${value}`) - } - console.log('') - } - console.log(` HTTP ${response.statusCode} ${response.statusPhrase}`) - for (const [key, value] of Object.entries(response.getHeaders())) { - console.log(` ${key}: ${value}`) - } - } - console.log('') -} diff --git a/test/fixtures/cache-tests/tests/age-parse.mjs b/test/fixtures/cache-tests/tests/age-parse.mjs deleted file mode 100644 index f304b3268a9..00000000000 --- a/test/fixtures/cache-tests/tests/age-parse.mjs +++ /dev/null @@ -1,301 +0,0 @@ -export default - -{ - name: 'Age Parsing', - id: 'age-parse', - description: 'These tests check how caches parse the `Age` response header.', - spec_anchors: ['field.age', 'expiration.model'], - tests: [ - { - name: 'HTTP cache should ignore an `Age` header with a non-numeric value', - id: 'age-parse-nonnumeric', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', 'abc', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache should ignore an `Age` header with a negative value', - id: 'age-parse-negative', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '-7200', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache should ignore an `Age` header with a float value', - id: 'age-parse-float', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '7200.0', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache should consider a response with a `Age` value of 2147483647 to be stale', - id: 'age-parse-large-minus-one', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '2147483647', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache should consider a response with a `Age` value of 2147483648 to be stale', - id: 'age-parse-large', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '2147483648', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache should consider a response with a `Age` value of 2147483649 to be stale', - id: 'age-parse-larger', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '2147483649', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache should consider a response with a single `Age` header line `old, 0` to be stale', - id: 'age-parse-suffix', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '7200, 0', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache should consider a response with a single `Age` header line `0, old` to be fresh', - id: 'age-parse-prefix', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '0, 7200', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache should use the first line in a response with multiple `Age` header lines: `old`, `0`', - id: 'age-parse-suffix-twoline', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '7200', false], - ['Age', '0', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache should use the first line in a response with multiple `Age` header lines: `0`, `old`', - id: 'age-parse-prefix-twoline', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '0', false], - ['Age', '7200', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache should consider a response with a single line `Age: 0, 0` to be fresh', - id: 'age-parse-dup-0', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '0, 0', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache should consider a response with two `Age: 0` header lines to be fresh', - id: 'age-parse-dup-0-twoline', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '0', false], - ['Age', '0', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache should consider a response with two `Age: not_old` header lines to be fresh', - id: 'age-parse-dup-old', - depends_on: ['freshness-max-age-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=10000'], - ['Age', '3600', false], - ['Age', '3600', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache consider an alphabetic parameter on `Age` header to be valid?', - id: 'age-parse-parameter', - depends_on: ['freshness-max-age-age'], - kind: 'check', - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '7200;foo=bar', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache should consider a numeric parameter on `Age` header to be valid?', - id: 'age-parse-numeric-parameter', - depends_on: ['freshness-max-age-age'], - kind: 'check', - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '7200;foo=111', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/authorization.mjs b/test/fixtures/cache-tests/tests/authorization.mjs deleted file mode 100644 index ba35a39fda4..00000000000 --- a/test/fixtures/cache-tests/tests/authorization.mjs +++ /dev/null @@ -1,110 +0,0 @@ -import * as templates from './lib/templates.mjs' - -export default - -{ - name: 'Storing Respones to Authenticated Requests', - id: 'auth', - description: 'These tests check for behaviours regarding authenticated HTTP responses.', - spec_anchors: ['caching.authenticated.responses'], - tests: [ - { - name: 'HTTP shared cache must not reuse a response to a request that contained `Authorization`, even with explicit freshness', - id: 'other-authorization', - depends_on: ['freshness-max-age'], - browser_skip: true, - requests: [ - templates.fresh({ - request_headers: [ - ['Authorization', 'FOO'] - ], - expected_request_headers: [ - ['Authorization', 'FOO'] - ] - }), - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP shared cache reuses a response to a request that contained `Authorization`, if it has `Cache-Control: public`', - id: 'other-authorization-public', - kind: 'optimal', - browser_skip: true, - depends_on: ['other-authorization'], - spec_anchors: ['cache-response-directive.public'], - requests: [ - { - request_headers: [ - ['Authorization', 'FOO'] - ], - expected_request_headers: [ - ['Authorization', 'FOO'] - ], - response_headers: [ - ['Cache-Control', 'max-age=3600, public'], - ['Date', 0] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP shared cache reuses a response to a request that contained `Authorization`, if it has `Cache-Control: must-revalidate`', - id: 'other-authorization-must-revalidate', - kind: 'optimal', - browser_skip: true, - depends_on: ['other-authorization'], - requests: [ - { - request_headers: [ - ['Authorization', 'FOO'] - ], - expected_request_headers: [ - ['Authorization', 'FOO'] - ], - response_headers: [ - ['Cache-Control', 'max-age=3600, must-revalidate'], - ['Date', 0] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP shared cache reuses a response to a request that contained `Authorization`, if it has `Cache-Control: s-maxage`', - id: 'other-authorization-smaxage', - kind: 'optimal', - browser_skip: true, - depends_on: ['other-authorization'], - requests: [ - { - request_headers: [ - ['Authorization', 'FOO'] - ], - expected_request_headers: [ - ['Authorization', 'FOO'] - ], - response_headers: [ - ['Cache-Control', 's-maxage=3600'], - ['Date', 0] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached' - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/cc-freshness.mjs b/test/fixtures/cache-tests/tests/cc-freshness.mjs deleted file mode 100644 index 64e57642a26..00000000000 --- a/test/fixtures/cache-tests/tests/cc-freshness.mjs +++ /dev/null @@ -1,468 +0,0 @@ -import * as templates from './lib/templates.mjs' - -export default - -{ - name: 'Cache-Control Freshness', - id: 'cc-freshness', - description: 'These tests check how caches calculate freshness using `Cache-Control`.', - spec_anchors: ['expiration.model', 'cache-response-directive'], - tests: [ - { - name: 'Does HTTP cache avoid reusing a response without explict freshness information or a validator (reuse is allowed, but not common, and many tests rely upon a cache _not_ doing it)?', - id: 'freshness-none', - kind: 'check', - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - { - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with positive `Cache-Control: max-age`', - id: 'freshness-max-age', - kind: 'optimal', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with `Cache-Control: max-age` after it becomes stale', - id: 'freshness-max-age-stale', - kind: 'optimal', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - templates.becomeStale({}), - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with `Cache-Control: max-age=0`', - id: 'freshness-max-age-0', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=0'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with `Cache-Control: max-age: 2147483647`', - id: 'freshness-max-age-max-minus-1', - kind: 'optimal', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=2147483647'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with `Cache-Control: max-age: 2147483648`', - id: 'freshness-max-age-max', - kind: 'optimal', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=2147483648'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with `Cache-Control: max-age: 2147483649`', - id: 'freshness-max-age-max-plus-1', - kind: 'optimal', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=2147483649'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with `Cache-Control: max-age: 99999999999`', - id: 'freshness-max-age-max-plus', - kind: 'optimal', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=99999999999'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response when the `Age` header is greater than its `Cache-Control: max-age` freshness lifetime', - id: 'freshness-max-age-age', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-response-directive.max-age', 'field.age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Cache-Control', 'max-age=3600'], - ['Age', '7200'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache consider `Date` when applying `Cache-Control: max-age` (i.e., is `apparent_age` used)?', - id: 'freshness-max-age-date', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-response-directive.max-age'], - kind: 'check', - requests: [ - { - response_headers: [ - ['Date', -7200], - ['Cache-Control', 'max-age=3600'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with positive `Cache-Control: max-age` and a past `Expires`', - id: 'freshness-max-age-expires', - depends_on: ['freshness-max-age'], - kind: 'optimal', - spec_anchors: ['cache-response-directive.max-age', 'field.expires'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Expires', -7200], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with positive `Cache-Control: max-age` and an invalid `Expires`', - id: 'freshness-max-age-expires-invalid', - depends_on: ['freshness-max-age'], - kind: 'optimal', - spec_anchors: ['cache-response-directive.max-age', 'field.expires'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Expires', '0', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with `Cache-Control: max-age=0` and a future `Expires`', - id: 'freshness-max-age-0-expires', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.max-age', 'field.expires'], - requests: [ - { - response_headers: [ - ['Expires', 3600], - ['Cache-Control', 'max-age=0'], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with positive `Cache-Control: max-age` and a CC extension present', - id: 'freshness-max-age-extension', - kind: 'optimal', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache.control.extensions'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'foobar, max-age=3600'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with positive `Cache-Control: MaX-AgE`', - id: 'freshness-max-age-case-insenstive', - kind: 'optimal', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'MaX-aGe=3600'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with negative `Cache-Control: max-age`', - id: 'freshness-max-age-negative', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=-3600'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Private HTTP cache must not prefer `Cache-Control: s-maxage` over shorter `Cache-Control: max-age`', - id: 'freshness-max-age-s-maxage-private', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-response-directive.max-age', 'cache-response-directive.s-maxage'], - requests: [ - { - response_headers: [ - ['Cache-Control', 's-maxage=3600, max-age=1'] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'not_cached' - } - ], - browser_only: true - }, - { - name: 'Private HTTP cache must not prefer `Cache-Control: s-maxage` over shorter `Cache-Control: max-age` (multiple headers)', - id: 'freshness-max-age-s-maxage-private-multiple', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-response-directive.max-age', 'cache-response-directive.s-maxage'], - requests: [ - { - response_headers: [ - ['Cache-Control', 's-maxage=3600'], - ['Cache-Control', 'max-age=1'] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'not_cached' - } - ], - browser_only: true - }, - { - name: 'An optimal shared HTTP cache reuses a response with positive `Cache-Control: s-maxage`', - id: 'freshness-s-maxage-shared', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.s-maxage'], - requests: [ - { - response_headers: [ - ['Cache-Control', 's-maxage=3600'] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached' - } - ], - browser_skip: true - }, - { - name: 'Shared HTTP cache must prefer short `Cache-Control: s-maxage` over a longer `Cache-Control: max-age`', - id: 'freshness-max-age-s-maxage-shared-longer', - depends_on: ['freshness-s-maxage-shared'], - spec_anchors: ['cache-response-directive.max-age', 'cache-response-directive.s-maxage'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600, s-maxage=1'] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'not_cached' - } - ], - browser_skip: true - }, - { - name: 'Shared HTTP cache must prefer short `Cache-Control: s-maxage` over a longer `Cache-Control: max-age` (reversed)', - id: 'freshness-max-age-s-maxage-shared-longer-reversed', - depends_on: ['freshness-s-maxage-shared'], - spec_anchors: ['cache-response-directive.max-age', 'cache-response-directive.s-maxage'], - requests: [ - { - response_headers: [ - ['Cache-Control', 's-maxage=1, max-age=3600'] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'not_cached' - } - ], - browser_skip: true - }, - { - name: 'Shared HTTP cache must prefer short `Cache-Control: s-maxage` over a longer `Cache-Control: max-age` (multiple headers)', - id: 'freshness-max-age-s-maxage-shared-longer-multiple', - depends_on: ['freshness-s-maxage-shared'], - spec_anchors: ['cache-response-directive.max-age', 'cache-response-directive.s-maxage'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Cache-Control', 's-maxage=1'] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'not_cached' - } - ], - browser_skip: true - }, - { - name: 'An optimal shared HTTP cache prefers long `Cache-Control: s-maxage` over a shorter `Cache-Control: max-age`', - id: 'freshness-max-age-s-maxage-shared-shorter', - depends_on: ['freshness-s-maxage-shared'], - kind: 'optimal', - spec_anchors: ['cache-response-directive.max-age', 'cache-response-directive.s-maxage'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1, s-maxage=3600'] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached' - } - ], - browser_skip: true - }, - { - name: 'An optimal shared HTTP cache prefers long `Cache-Control: s-maxage` over `Cache-Control: max-age=0`, even with a past `Expires`', - id: 'freshness-max-age-s-maxage-shared-shorter-expires', - depends_on: ['freshness-s-maxage-shared'], - kind: 'optimal', - spec_anchors: ['cache-response-directive.max-age', 'cache-response-directive.s-maxage'], - requests: [ - { - response_headers: [ - ['Expires', -10], - ['Cache-Control', 'max-age=0, s-maxage=3600'] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached' - } - ], - browser_skip: true - } - ] -} diff --git a/test/fixtures/cache-tests/tests/cc-parse.mjs b/test/fixtures/cache-tests/tests/cc-parse.mjs deleted file mode 100644 index 58b9a6319a1..00000000000 --- a/test/fixtures/cache-tests/tests/cc-parse.mjs +++ /dev/null @@ -1,278 +0,0 @@ -export default - -{ - name: 'Cache-Control Parsing', - id: 'cc-parse', - description: 'These tests check how caches parse the `Cache-Control` response header.', - spec_anchors: ['field.cache-control'], - tests: [ - { - name: 'Does HTTP cache reuse a response when first `Cache-Control: max-age` is fresh, but second is stale (same line)?', - id: 'freshness-max-age-two-fresh-stale-sameline', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1800, max-age=1', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a response when first `Cache-Control: max-age` is fresh, but second is stale (separate lines)?', - id: 'freshness-max-age-two-fresh-stale-sepline', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1800', false], - ['Cache-Control', 'max-age=1', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a response when first `Cache-Control: max-age` is stale, but second is fresh (same line)?', - id: 'freshness-max-age-two-stale-fresh-sameline', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1, max-age=1800', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a response when first `Cache-Control: max-age` is stale, but second is fresh (separate lines)?', - id: 'freshness-max-age-two-stale-fresh-sepline', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1', false], - ['Cache-Control', 'max-age=1800', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a response with a quoted `Cache-Control: max-age`?', - id: 'freshness-max-age-quoted', - kind: 'check', - depends_on: ['freshness-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age="3600"', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with `max-age` in a quoted string (before the "real" `max-age`)', - id: 'freshness-max-age-ignore-quoted', - depends_on: ['freshness-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'extension="max-age=3600", max-age=1', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache mut not reuse a response with `max-age` in a quoted string (after the "real" `max-age`)', - id: 'freshness-max-age-ignore-quoted-rev', - depends_on: ['freshness-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1, extension="max-age=3600"', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache ignore max-age with space before the `=`?', - id: 'freshness-max-age-space-before-equals', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age =3600', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache ignore max-age with space after the `=`?', - id: 'freshness-max-age-space-after-equals', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age= 3600', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses max-age with the value `003600`', - id: 'freshness-max-age-leading-zero', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=003600', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with a single-quoted `Cache-Control: max-age`', - id: 'freshness-max-age-single-quoted', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=\'3600\'', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache reuse max-age with `3600.0` value?', - id: 'freshness-max-age-decimal-zero', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600.0', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse max-age with `3600.5` value?', - id: 'freshness-max-age-decimal-five', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600.5', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a response with an invalid `Cache-Control: max-age` (leading alpha)?', - id: 'freshness-max-age-a100', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=a3600', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a response with an invalid `Cache-Control: max-age` (trailing alpha)?', - id: 'freshness-max-age-100a', - kind: 'check', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600a', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/cc-request.mjs b/test/fixtures/cache-tests/tests/cc-request.mjs deleted file mode 100644 index 4638b28ffdf..00000000000 --- a/test/fixtures/cache-tests/tests/cc-request.mjs +++ /dev/null @@ -1,241 +0,0 @@ -import * as templates from './lib/templates.mjs' -import * as utils from './lib/utils.mjs' - -export default { - name: 'Cache-Control Request Directives', - id: 'cc-request', - description: 'These tests check to see if caches respect `Cache-Control` request directives. Note that HTTP does not require them to be supported.', - spec_anchors: ['cache-request-directive'], - tests: [ - { - name: 'Does HTTP cache honor request `Cache-Control: max-age=0` when it holds a fresh response?', - id: 'ccreq-ma0', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.max-age'], - requests: [ - templates.fresh({}), - { - request_headers: [ - ['Cache-Control', 'max-age=0'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache honour request `Cache-Control: max-age=1` when it holds a fresh response?', - id: 'ccreq-ma1', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.max-age'], - requests: [ - templates.fresh({}), - { - request_headers: [ - ['Cache-Control', 'max-age=1'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache honour request `Cache-Control: max-age` when it holds a fresh but `Age`d response that is not fresh enough?', - id: 'ccreq-magreaterage', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.max-age'], - requests: [ - templates.fresh({ - response_headers: [ - ['Age', '1800'] - ] - }), - { - request_headers: [ - ['Cache-Control', 'max-age=600'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a stale response when request `Cache-Control: max-stale` allows it?', - id: 'ccreq-max-stale', - kind: 'check', - depends_on: ['freshness-max-age-stale'], - spec_anchors: ['cache-request-directive.max-stale'], - requests: [ - templates.becomeStale({}), - { - request_headers: [ - ['Cache-Control', 'max-stale=1000'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a stale `Age`d response when request `Cache-Control: max-stale` allows it?', - id: 'ccreq-max-stale-age', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.max-stale'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1500'], - ['Age', '2000'] - ], - setup: true - }, - { - request_headers: [ - ['Cache-Control', 'max-stale=1000'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache honour request `Cache-Control: min-fresh` when the response it holds is not fresh enough?', - id: 'ccreq-min-fresh', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.min-fresh'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1500'] - ], - setup: true - }, - { - request_headers: [ - ['Cache-Control', 'min-fresh=2000'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache honour request `Cache-Control: min-fresh` when the `Age`d response it holds is not fresh enough?', - id: 'ccreq-min-fresh-age', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.min-fresh'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1500'], - ['Age', '1000'] - ], - setup: true - }, - { - request_headers: [ - ['Cache-Control', 'min-fresh=1000'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache honour request `Cache-Control: no-cache` when it holds a fresh response?', - id: 'ccreq-no-cache', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.no-cache'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'] - ], - setup: true - }, - { - request_headers: [ - ['Cache-Control', 'no-cache'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache honour request `Cache-Control: no-cache` by validating a response with `Last-Modified`?', - id: 'ccreq-no-cache-lm', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.no-cache'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Last-Modified', -10000], - ['Date', 0] - ], - setup: true - }, - { - request_headers: [ - ['Cache-Control', 'no-cache'] - ], - expected_type: 'lm_validated' - } - ] - }, - { - name: 'Does HTTP cache honour request `Cache-Control: no-cache` by validating a response with an `ETag`?', - id: 'ccreq-no-cache-etag', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.no-cache'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['ETag', `"${utils.httpContent('abc')}"`] - ], - setup: true - }, - { - request_headers: [ - ['Cache-Control', 'no-cache'] - ], - expected_type: 'etag_validated' - } - ] - }, - { - name: 'Does HTTP cache honour request `Cache-Control: no-store` when it holds a fresh response?', - id: 'ccreq-no-store', - kind: 'check', - depends_on: ['freshness-max-age'], - spec_anchors: ['cache-request-directive.no-store'], - requests: [ - templates.fresh({}), - { - request_headers: [ - ['Cache-Control', 'no-store'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache honour request `Cache-Control: only-if-cached` by generating a `504` response when it does not have a stored response?', - id: 'ccreq-oic', - kind: 'check', - spec_anchors: ['cache-request-directive.only-if-cached'], - requests: [ - { - request_headers: [ - ['Cache-Control', 'only-if-cached'] - ], - expected_status: 504, - expected_response_text: null - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/cc-response.mjs b/test/fixtures/cache-tests/tests/cc-response.mjs deleted file mode 100644 index 1c81bec70eb..00000000000 --- a/test/fixtures/cache-tests/tests/cc-response.mjs +++ /dev/null @@ -1,375 +0,0 @@ -export default - -{ - name: 'Cache-Control Response Directives', - id: 'cc-response', - description: 'These tests check how caches handle response `Cache-Control` directives other than those related to freshness, like `no-cache` and `no-store`.', - spec_anchors: ['cache-response-directive'], - tests: [ - { - name: 'Shared HTTP cache must not store a response with `Cache-Control: private`', - id: 'cc-resp-private-shared', - browser_skip: true, - spec_anchors: ['cache-response-directive.private'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'private, max-age=3600'] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal private HTTP cache reuses a fresh response with `Cache-Control: private`', - id: 'cc-resp-private-private', - browser_only: true, - kind: 'optimal', - spec_anchors: ['cache-response-directive.private'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'private, max-age=3600'] - ], - setup: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not store a response with `Cache-Control: no-store`', - id: 'cc-resp-no-store', - spec_anchors: ['cache-response-directive.no-store'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'no-store'] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not store a response with `Cache-Control: nO-StOrE`', - id: 'cc-resp-no-store-case-insensitive', - depends_on: ['cc-resp-no-store'], - spec_anchors: ['cache-response-directive.no-store'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'No-StOrE'] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not store a response with `Cache-Control: no-store`, even with `max-age` and `Expires`', - id: 'cc-resp-no-store-fresh', - depends_on: ['cc-resp-no-store'], - spec_anchors: ['cache-response-directive.no-store'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=10000, no-store'], - ['Expires', 10000], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does HTTP cache use older stored response when newer one came with `Cache-Control: no-store`?', - id: 'cc-resp-no-store-old-new', - depends_on: ['cc-resp-no-store'], - spec_anchors: ['cache-response-directive.no-store'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=10000'], - ['Expires', 10000], - ['Date', 0], - ['A', '1'] - ], - setup: true, - pause_after: true - }, - { - response_headers: [ - ['Cache-Control', 'no-store'], - ['Date', 0], - ['A', '2'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached', - expected_response_headers: [['a', '1']] - } - ] - }, - { - name: 'Does HTTP cache use older stored response when newer one came with `Cache-Control: no-store, max-age=0`?', - id: 'cc-resp-no-store-old-max-age', - depends_on: ['cc-resp-no-store'], - spec_anchors: ['cache-response-directive.no-store'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=10000'], - ['Expires', 10000], - ['Date', 0], - ['A', '1'] - ], - setup: true, - pause_after: true - }, - { - response_headers: [ - ['Cache-Control', 'no-store, max-age=0'], - ['Date', 0], - ['A', '2'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached', - expected_response_headers: [['a', '1']] - } - ] - }, - { - name: 'HTTP cache must not use a cached response with `Cache-Control: no-cache`, even with `max-age` and `Expires`', - id: 'cc-resp-no-cache', - spec_anchors: ['cache-response-directive.no-cache'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=10000, no-cache'], - ['Expires', 10000], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not use a cached response with `Cache-Control: No-CaChE`, even with `max-age` and `Expires`', - id: 'cc-resp-no-cache-case-insensitive', - depends_on: ['cc-resp-no-cache'], - spec_anchors: ['cache-response-directive.no-cache'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=10000, No-CaChE'], - ['Expires', 10000], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache stores a response with `Cache-Control: no-cache`, but revalidates it upon use', - id: 'cc-resp-no-cache-revalidate', - kind: 'optimal', - depends_on: ['cc-resp-no-cache'], - spec_anchors: ['cache-response-directive.no-cache'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'no-cache'], - ['ETag', '"abcd"'] - ], - setup: true - }, - { - expected_type: 'etag_validated' - } - ] - }, - { - name: 'An optimal HTTP cache stores a response with `Cache-Control: no-cache`, but revalidates it upon use, even with `max-age` and `Expires`', - id: 'cc-resp-no-cache-revalidate-fresh', - kind: 'optimal', - depends_on: ['cc-resp-no-cache'], - spec_anchors: ['cache-response-directive.no-cache'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=10000, no-cache'], - ['Expires', 10000], - ['Date', 0], - ['ETag', '"abcd"'] - ], - setup: true - }, - { - expected_type: 'etag_validated' - } - ] - }, - { - name: 'Does `Cache-Control: no-cache` inhibit storing a listed header?', - id: 'headers-omit-headers-listed-in-Cache-Control-no-cache-single', - kind: 'check', - depends_on: ['cc-resp-no-cache-revalidate'], - spec_anchors: ['cache-response-directive.no-cache'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'no-cache="a"'], - ['a', '1'], - ['b', '2'], - ['Cache-Control', 'max-age=3600'], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached', - expected_response_headers: [['b', '2']], - expected_response_headers_missing: ['a'], - setup_tests: ['expected_type'] - } - ] - }, - { - name: 'Does `Cache-Control: no-cache` inhibit storing multiple listed headers?', - id: 'headers-omit-headers-listed-in-Cache-Control-no-cache', - kind: 'check', - depends_on: ['cc-resp-no-cache-revalidate'], - spec_anchors: ['cache-response-directive.no-cache'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'no-cache="a, b"'], - ['a', '1'], - ['b', '2'], - ['c', '3'], - ['Cache-Control', 'max-age=3600'], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached', - expected_response_headers: [['c', '3']], - expected_response_headers_missing: ['a', 'b'], - setup_tests: ['expected_type'] - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with positive `Cache-Control: max-age, must-revalidate`', - id: 'cc-resp-must-revalidate-fresh', - kind: 'optimal', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.must-revalidate'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=10000, must-revalidate'], - ['ETag', '"abcd"'] - ], - setup: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must revalidate a stale response with positive `Cache-Control: max-age, must-revalidate`', - id: 'cc-resp-must-revalidate-stale', - depends_on: ['freshness-none'], - spec_anchors: ['cache-response-directive.must-revalidate'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=2, must-revalidate'], - ['ETag', '"abcd"'] - ], - setup: true - }, - { - expected_type: 'cached', - setup: true, - pause_after: true, - response_headers: [ - ['Cache-Control', 'max-age=2, must-revalidate'], - ['ETag', '"abcd"'] - ] - }, - { - expected_type: 'etag_validated' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a fresh response with `Cache-Control: immutable` without revalidation.', - id: 'cc-resp-immutable-fresh', - kind: 'optimal', - browser_only: true, - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=10000, immutable'], - ['ETag', '"abcd"'] - ], - setup: true, - pause_after: true - }, - { - cache: 'no-cache', - expected_type: 'cached' - } - ] - }, - { - name: 'A HTTP cache MUST revalidate a stale response with `Cache-Control: immutable`', - id: 'cc-resp-immutable-stale', - browser_only: true, - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=2, immutable'], - ['ETag', '"abcd"'] - ], - setup: true, - pause_after: true - }, - { - cache: 'no-cache', - expected_type: 'etag_validated', - expected_request_headers: [['cache-control', 'max-age=0']] - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/cdn-cache-control.mjs b/test/fixtures/cache-tests/tests/cdn-cache-control.mjs deleted file mode 100644 index e7f0d139c98..00000000000 --- a/test/fixtures/cache-tests/tests/cdn-cache-control.mjs +++ /dev/null @@ -1,491 +0,0 @@ -export default - -{ - name: 'CDN-Cache-Control', - id: 'cdn-cache-control', - description: 'These tests check non-browser caches for behaviours around the [`CDN-Cache-Control` response header](https://httpwg.org/specs/rfc9213.html).', - tests: [ - { - name: 'An optimal CDN reuses a response with positive `CDN-Cache-Control: max-age`', - id: 'cdn-max-age', - cdn_only: true, - depends_on: ['freshness-none'], - kind: 'optimal', - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'max-age=3600', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal CDN reuses a response with `CDN-Cache-Control: max-age: 2147483648`', - id: 'cdn-max-age-max', - kind: 'optimal', - cdn_only: true, - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'max-age=2147483648', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal CDN reuses a response with `CDN-Cache-Control: max-age: 99999999999`', - id: 'cdn-max-age-max-plus', - kind: 'optimal', - cdn_only: true, - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'max-age=99999999999', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'CDN must not reuse a response when the `Age` header is greater than its `CDN-Cache-Control: max-age` freshness lifetime', - id: 'cdn-max-age-age', - cdn_only: true, - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['CDN-Cache-Control', 'max-age=3600', false], - ['Age', '7200'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does CDN ignore `CDN-Cache-Control: max-age` with space before the `=`?', - id: 'cdn-max-age-space-before-equals', - cdn_only: true, - kind: 'check', - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1'], - ['CDN-Cache-Control', 'max-age =100', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does CDN ignore `CDN-Cache-Control: max-age` with space after the `=`?', - id: 'cdn-max-age-space-after-equals', - cdn_only: true, - kind: 'check', - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1'], - ['CDN-Cache-Control', 'max-age= 100', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'CDN must not reuse a response with `CDN-Cache-Control: max-age=0`', - id: 'cdn-max-age-0', - cdn_only: true, - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'max-age=0', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal CDN reuses a response with a positive `CDN-Cache-Control: max-age` and an extension cache directive', - id: 'cdn-max-age-extension', - cdn_only: true, - kind: 'optimal', - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'foobar, max-age=3600', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does CDN reuse a response with a positive `CDN-Cache-Control: MaX-aGe`?', - id: 'cdn-max-age-case-insensitive', - cdn_only: true, - kind: 'check', - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'MaX-aGe=3600', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - - { - name: 'An optimal CDN reuses a response with a positive `CDN-Cache-Control: max-age` and a past `Expires`', - id: 'cdn-max-age-expires', - cdn_only: true, - kind: 'optimal', - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'max-age=3600', false], - ['Expires', -10000], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal CDN reuses a response with a positive `CDN-Cache-Control: max-age` and an invalid `Expires`', - id: 'cdn-max-age-cc-max-age-invalid-expires', - cdn_only: true, - kind: 'optimal', - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'max-age=3600', false], - ['Expires', '0', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'CDN must not reuse a response with a `CDN-Cache-Control: max-age=0` and a future `Expires`', - id: 'cdn-max-age-0-expires', - cdn_only: true, - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'max-age=0', false], - ['Expires', 10000], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal CDN prefers a long `CDN-Cache-Control: max-age` over a short `Cache-Control: max-age`', - id: 'cdn-max-age-short-cc-max-age', - cdn_only: true, - kind: 'optimal', - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1'], - ['CDN-Cache-Control', 'max-age=3600', false] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'CDN must prefer a short `CDN-Cache-Control: max-age` over a long `Cache-Control: max-age`', - id: 'cdn-max-age-long-cc-max-age', - cdn_only: true, - depends_on: ['cdn-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['CDN-Cache-Control', 'max-age=1', false] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'CDN must not reuse a cached response with `CDN-Cache-Control: private`, even with `Cache-Control: max-age` and `Expires`', - id: 'cdn-private', - cdn_only: true, - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'private'], - ['Cache-Control', 'max-age=10000'], - ['Expires', 10000], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'CDN must not reuse a cached response with `CDN-Cache-Control: no-cache`, even with `Cache-Control: max-age` and `Expires`', - id: 'cdn-no-cache', - cdn_only: true, - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'no-cache'], - ['Cache-Control', 'max-age=10000'], - ['Expires', 10000], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'CDN must not store a response with `CDN-Cache-Control: no-store`, even with `Cache-Control: max-age` and `Expires`', - id: 'cdn-no-store-cc-fresh', - cdn_only: true, - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=10000'], - ['CDN-Cache-Control', 'no-store', false], - ['Expires', 10000], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal CDN stores a response with a fresh `CDN-Cache-Control: max-age`, even with `Cache-Control: no-store`', - id: 'cdn-fresh-cc-nostore', - depends_on: ['freshness-none'], - cdn_only: true, - requests: [ - { - response_headers: [ - ['Cache-Control', 'no-store'], - ['CDN-Cache-Control', 'max-age=10000', false] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'CDN should ignore a `CDN-Cache-Control` that\'s an invalid Structured Field (unknown type)', - id: 'cdn-cc-invalid-sh-type-unknown', - depends_on: ['cdn-max-age'], - cdn_only: true, - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'max-age=10000, &&&&&', false], - ['Cache-Control', 'no-store'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'CDN should ignore a `CDN-Cache-Control` that\'s an invalid Structured Field (wrong type)', - id: 'cdn-cc-invalid-sh-type-wrong', - depends_on: ['cdn-max-age'], - cdn_only: true, - requests: [ - { - response_headers: [ - ['CDN-Cache-Control', 'max-age="10000"', false], - ['Cache-Control', 'no-store'] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'Does the CDN forward the `CDN-Cache-Control` response header?', - id: 'cdn-remove-header', - cdn_only: true, - kind: 'check', - requests: [ - { - // only check for the header in expected_response_headers, so failing - // this is an assertion failure and not a setup error - response_headers: [ - ['Cache-Control', 'max-age=10000'], - ['CDN-Cache-Control', 'foo', false], - ['Expires', 10000], - ['Date', 0] - ], - expected_response_headers: [ - ['CDN-Cache-Control', 'foo'] - ] - } - ] - }, - { - name: 'Does the CDN send `Age` when `CDN-Cache-Control: max-age` exceeds `Cache-Control: max-age`?', - id: 'cdn-remove-age-exceed', - cdn_only: true, - depends_on: ['cdn-max-age'], - kind: 'check', - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1'], - ['CDN-Cache-Control', 'max-age=10000'], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_response_headers: [ - 'Age' - ] - } - ] - }, - { - name: 'Does the CDN preserve `Date` when `CDN-Cache-Control: max-age` exceeds `Cache-Control: max-age`?', - id: 'cdn-date-update-exceed', - cdn_only: true, - depends_on: ['cdn-max-age'], - kind: 'check', - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1'], - ['CDN-Cache-Control', 'max-age=10000'], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_response_headers: [ - ['Date', 0] - ] - } - ] - }, - { - name: 'Does the CDN preserve `Expires` when `CDN-Cache-Control: max-age` exceeds `Cache-Control: max-age`?', - id: 'cdn-expires-update-exceed', - cdn_only: true, - depends_on: ['cdn-max-age'], - kind: 'check', - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=1'], - ['Expires', 1], - ['CDN-Cache-Control', 'max-age=10000'], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_response_headers: [ - ['Expires', 1] - ] - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/conditional-etag.mjs b/test/fixtures/cache-tests/tests/conditional-etag.mjs deleted file mode 100644 index 98d9177ec63..00000000000 --- a/test/fixtures/cache-tests/tests/conditional-etag.mjs +++ /dev/null @@ -1,456 +0,0 @@ -import * as templates from './lib/templates.mjs' - -export default { - name: 'Conditional Requests: If-None-Match and ETag', - id: 'conditional-inm', - description: 'These tests check handling of conditional requests using `If-None-Match` and `ETag`.', - spec_anchors: ['validation.model'], - tests: [ - { - name: 'An optimal HTTP cache responds to `If-None-Match` with a `304` when holding a fresh response with a matching strong `ETag`', - id: 'conditional-etag-strong-respond', - kind: 'optimal', - depends_on: ['freshness-max-age'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', '"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', '"abcdef"'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'HTTP cache must include `ETag` in a `304 Not Modified`', - id: 'conditional-304-etag', - depends_on: ['conditional-etag-strong-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', '"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', '"abcdef"'] - ], - expected_type: 'cached', - expected_status: 304, - expected_response_headers: [ - ['ETag', '"abcdef"'] - ] - } - ] - }, - { - name: 'HTTP cache must give precedence to `If-None-Match` over `If-Modified-Since`', - id: 'conditional-etag-precedence', - depends_on: ['conditional-etag-strong-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['Last-Modified', -5000], - ['ETag', '"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', '"abcdef"'], - ['If-Modified-Since', -1] - ], - magic_ims: true, - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'Does HTTP cache responds to `If-None-Match` with a `304` when holding a fresh response with a matching strong `ETag` containing obs-text?', - id: 'conditional-etag-strong-respond-obs-text', - kind: 'check', - depends_on: ['conditional-etag-strong-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', '"abcdefü"'] - ] - }), - { - request_headers: [ - ['If-None-Match', '"abcdefü"'] - ], - expected_type: 'cached', - expected_status: 304, - expected_response_headers: [ - ['ETag', '"abcdefü"'] - ] - } - ] - }, - { - name: 'HTTP cache responds to unquoted `If-None-Match` with a `304` when holding a fresh response with a matching strong `ETag` that is quoted', - id: 'conditional-etag-quoted-respond-unquoted', - kind: 'check', - depends_on: ['conditional-etag-strong-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', '"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', 'abcdef'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'HTTP cache responds to unquoted `If-None-Match` with a `304` when holding a fresh response with a matching strong `ETag` that is unquoted', - id: 'conditional-etag-unquoted-respond-unquoted', - kind: 'check', - depends_on: ['conditional-etag-strong-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', 'abcdef'] - ] - }), - { - request_headers: [ - ['If-None-Match', 'abcdef'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'HTTP cache responds to quoted `If-None-Match` with a `304` when holding a fresh response with a matching strong `ETag` that is unquoted', - id: 'conditional-etag-unquoted-respond-quoted', - kind: 'check', - depends_on: ['conditional-etag-strong-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', 'abcdef'] - ] - }), - { - request_headers: [ - ['If-None-Match', '"abcdef"'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'An optimal HTTP cache responds to `If-None-Match` with a `304` when holding a fresh response with a matching weak `ETag`', - id: 'conditional-etag-weak-respond', - kind: 'optimal', - depends_on: ['freshness-max-age'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', 'W/"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', 'W/"abcdef"'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'HTTP cache responds to `If-None-Match` with a `304` when holding a fresh response with a matching weak `ETag`, and the entity-tag weakness flag is lowercase', - id: 'conditional-etag-weak-respond-lowercase', - kind: 'check', - depends_on: ['conditional-etag-weak-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', 'w/"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', 'w/"abcdef"'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'HTTP cache responds to `If-None-Match` with a `304` when holding a fresh response with a matching weak `ETag`, and the entity-tag weakness flag uses `\\` instead of `/`', - id: 'conditional-etag-weak-respond-backslash', - kind: 'check', - depends_on: ['conditional-etag-weak-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', 'W\\"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', 'W\\"abcdef"'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'HTTP cache responds to `If-None-Match` with a `304` when holding a fresh response with a matching weak `ETag`, and the entity-tag weakness flag omits `/`', - id: 'conditional-etag-weak-respond-omit-slash', - depends_on: ['conditional-etag-weak-respond'], - kind: 'check', - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', 'W"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', 'W"abcdef"'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'An optimal HTTP cache responds to `If-None-Match` with a `304` when it contains multiple entity-tags (first one)', - id: 'conditional-etag-strong-respond-multiple-first', - kind: 'optimal', - depends_on: ['conditional-etag-strong-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', '"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', '"abcdef", "1234", "5678"'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'An optimal HTTP cache responds to `If-None-Match` with a `304` when it contains multiple entity-tags (middle one)', - id: 'conditional-etag-strong-respond-multiple-second', - kind: 'optimal', - depends_on: ['conditional-etag-strong-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', '"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', '"1234", "abcdef", "5678"'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'An optimal HTTP cache responds to `If-None-Match` with a `304` when it contains multiple entity-tags (last one)', - id: 'conditional-etag-strong-respond-multiple-last', - kind: 'optimal', - depends_on: ['conditional-etag-strong-respond'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['ETag', '"abcdef"'] - ] - }), - { - request_headers: [ - ['If-None-Match', '"1234", "5678", "abcdef"'] - ], - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'HTTP cache must include stored response headers identified by `Vary` in a conditional request it generates', - id: 'conditional-etag-vary-headers', - requests: [ - { - request_headers: [ - ['Abc', '123'] - ], - response_headers: [ - ['Expires', 1], - ['ETag', '"abcdef"'], - ['Date', 0], - ['Vary', 'Abc'] - ], - setup: true, - pause_after: true - }, - { - request_headers: [ - ['Abc', '123'] - ], - expected_type: 'etag_validated', - expected_request_headers: [ - ['Abc', '123'] - ], - setup_tests: ['expected_type'] - } - ] - }, - { - name: 'HTTP cache must not use a stored `ETag` to validate when the presented `Vary`ing request header differs', - id: 'conditional-etag-vary-headers-mismatch', - depends_on: ['conditional-etag-vary-headers', 'vary-no-match'], - requests: [ - { - request_headers: [ - ['Abc', '123'] - ], - response_headers: [ - ['Expires', 10000], - ['ETag', '"abcdef"'], - ['Date', 0], - ['Vary', 'Abc'] - ], - setup: true, - pause_after: true - }, - { - request_headers: [ - ['Abc', '456'] - ], - expected_request_headers_missing: [ - ['If-None-Match', '"abcdef"'] - ] - } - ] - }, - { - name: 'An optimal HTTP cache generates a `If-None-Match` request when holding a stale response with a matching strong `ETag`', - id: 'conditional-etag-strong-generate', - kind: 'optimal', - depends_on: ['freshness-max-age-stale'], - requests: [ - templates.becomeStale({ - response_headers: [ - ['ETag', '"abcdef"'] - ] - }), - { - expected_request_headers: [ - ['If-None-Match', '"abcdef"'] - ], - expected_type: 'etag_validated' - } - ] - }, - { - name: 'An optimal HTTP cache generates a `If-None-Match` request when holding a stale response with a matching weak `ETag`', - id: 'conditional-etag-weak-generate-weak', - kind: 'optimal', - depends_on: ['freshness-max-age-stale'], - requests: [ - templates.becomeStale({ - response_headers: [ - ['ETag', 'W/"abcdef"'] - ] - }), - { - expected_request_headers: [ - ['If-None-Match', 'W/"abcdef"'] - ], - expected_type: 'etag_validated' - } - ] - }, - { - name: 'Does HTTP cache generate a quoted `If-None-Match` request when holding a stale response with a matching, unquoted strong `ETag`?', - id: 'conditional-etag-strong-generate-unquoted', - kind: 'check', - depends_on: ['conditional-etag-strong-generate'], - requests: [ - templates.becomeStale({ - response_headers: [ - ['ETag', 'abcdef'] - ] - }), - { - expected_request_headers: [ - ['If-None-Match', '"abcdef"'] - ], - expected_type: 'etag_validated' - } - ] - }, - { - name: 'Does HTTP cache forward `If-None-Match` request header when no stored response is available?', - id: 'conditional-etag-forward', - kind: 'check', - requests: [ - { - request_headers: [ - ['If-None-Match', '"abcdef"'] - ], - expected_request_headers: [ - ['If-None-Match', '"abcdef"'] - ] - } - ] - }, - { - name: 'Does HTTP cache add quotes to an unquoted `If-None-Match` request when forwarding it?', - id: 'conditional-etag-forward-unquoted', - depends_on: ['conditional-etag-forward'], - kind: 'check', - requests: [ - { - request_headers: [ - ['If-None-Match', 'abcdef'] - ], - expected_request_headers: [ - ['If-None-Match', '"abcdef"'] - ] - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/conditional-lm.mjs b/test/fixtures/cache-tests/tests/conditional-lm.mjs deleted file mode 100644 index eae5c2bed89..00000000000 --- a/test/fixtures/cache-tests/tests/conditional-lm.mjs +++ /dev/null @@ -1,119 +0,0 @@ -import * as templates from './lib/templates.mjs' - -export default { - name: 'Conditional Requests: If-Modified-Since and Last-Modified', - id: 'conditional-lm', - description: 'These tests check handling of conditional requests using `If-Modified-Since` and `Last-Modified`.', - spec_anchors: ['validation.model'], - tests: [ - { - name: 'An optimal HTTP cache responds to `If-Modified-Since` with a `304` when holding a fresh response with a matching `Last-Modified`', - id: 'conditional-lm-fresh', - kind: 'optimal', - depends_on: ['freshness-max-age'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['Last-Modified', -3000] - ] - }), - { - request_headers: [ - ['If-Modified-Since', -3000] - ], - magic_ims: true, - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'An optimal HTTP cache responds to `If-Modified-Since` with a `304` when holding a fresh response with an earlier `Last-Modified`', - id: 'conditional-lm-fresh-earlier', - kind: 'optimal', - depends_on: ['freshness-max-age'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['Last-Modified', -3000] - ] - }), - { - request_headers: [ - ['If-Modified-Since', -2000] - ], - magic_ims: true, - expected_type: 'cached', - expected_status: 304 - } - ] - }, - { - name: 'An optimal HTTP cache responds to `If-Modified-Since` with a `304` when holding a stale response with a matching `Last-Modified`, after validation', - id: 'conditional-lm-stale', - kind: 'optimal', - depends_on: ['freshness-max-age-stale'], - browser_skip: true, - requests: [ - templates.becomeStale({ - response_headers: [ - ['Last-Modified', -3000] - ] - }), - { - request_headers: [ - ['If-Modified-Since', -3000] - ], - magic_ims: true, - expected_type: 'lm_validated', - expected_status: 304 - } - ] - }, - { - name: 'An optimal HTTP cache responds to `If-Modified-Since` with a `304` when holding a newer fresh response with no `Last-Modified`', - id: 'conditional-lm-fresh-no-lm', - kind: 'optimal', - depends_on: ['freshness-max-age'], - browser_skip: true, - requests: [ - templates.fresh({}), - { - request_headers: [ - ['If-Modified-Since', -3000] - ], - magic_ims: true, - expected_type: 'cached', - expected_status: 304, - setup_tests: ['expected_type'] - } - ] - }, - { - name: 'An optimal HTTP cache responds to `If-Modified-Since` with a `304` when holding a newer fresh response when IMS uses an equivalent rfc850 date', - id: 'conditional-lm-fresh-rfc850', - kind: 'optimal', - depends_on: ['freshness-max-age'], - browser_skip: true, - requests: [ - templates.fresh({ - response_headers: [ - ['Last-Modified', -3000] - ] - }), - { - request_headers: [ - ['If-Modified-Since', -3000] - ], - magic_ims: true, - rfc850date: ['if-modified-since'], - expected_type: 'cached', - expected_status: 304, - setup_tests: ['expected_type'] - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/expires-freshness.mjs b/test/fixtures/cache-tests/tests/expires-freshness.mjs deleted file mode 100644 index c0f6f9f727b..00000000000 --- a/test/fixtures/cache-tests/tests/expires-freshness.mjs +++ /dev/null @@ -1,154 +0,0 @@ -export default - -{ - name: 'Expires Freshness', - id: 'expires', - description: 'These tests check how caches calculate freshness using `Expires`.', - spec_anchors: ['expiration.model', 'field.expires'], - tests: [ - { - name: 'An optimal HTTP cache reuses a response with a future `Expires`', - id: 'freshness-expires-future', - kind: 'optimal', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Expires', 30 * 24 * 60 * 60], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with a past `Expires`', - id: 'freshness-expires-past', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', -30 * 24 * 60 * 60], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with a present `Expires`', - id: 'freshness-expires-present', - depends_on: ['freshness-none'], - requests: [ - { - response_headers: [ - ['Expires', 0], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an `Expires` older than `Date`, both fast', - id: 'freshness-expires-old-date', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 300], - ['Date', 400] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (0)', - id: 'freshness-expires-invalid', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', '0', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with `Expires`, even if `Date` is invalid', - id: 'freshness-expires-invalid-date', - depends_on: ['freshness-expires-future'], - kind: 'optimal', - requests: [ - { - response_headers: [ - ['Date', 'foo', false], - ['Expires', 10] - ], - setup: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response when the `Age` header is greater than its `Expires` minus `Date`, and `Date` is slow', - id: 'freshness-expires-age-slow-date', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Date', -10], - ['Expires', 10], - ['Age', '25'] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response when the `Age` header is greater than its `Expires` minus `Date`, and `Date` is fast', - id: 'freshness-expires-age-fast-date', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Date', 10], - ['Expires', 20], - ['Age', '15'] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/expires-parse.mjs b/test/fixtures/cache-tests/tests/expires-parse.mjs deleted file mode 100644 index 74c93b516e7..00000000000 --- a/test/fixtures/cache-tests/tests/expires-parse.mjs +++ /dev/null @@ -1,301 +0,0 @@ -export default - -{ - name: 'Expires Parsing', - id: 'expires-parse', - description: 'These tests check how caches parse the `Expires` response header.', - spec_anchors: ['field.expires'], - tests: [ - { - name: 'An optimal HTTP cache reuses a response with an `Expires` that is exactly 32 bits', - id: 'freshness-expires-32bit', - kind: 'optimal', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Tue, 19 Jan 2038 14:14:08 GMT', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with an `Expires` that is far in the future', - id: 'freshness-expires-far-future', - kind: 'optimal', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Sun, 21 Nov 2286 04:46:39 GMT', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with a future `Expires` in obsolete RFC 850 format', - id: 'freshness-expires-rfc850', - kind: 'optimal', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thursday, 18-Aug-50 02:01:18 GMT', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with a future `Expires` in ANSI C\'s asctime() format', - id: 'freshness-expires-ansi-c', - kind: 'optimal', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu Aug 8 02:01:18 2050', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with a future `Expires` using wrong case (weekday)', - id: 'freshness-expires-wrong-case-weekday', - kind: 'optimal', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'THU, 18 Aug 2050 02:01:18 GMT', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with a future `Expires` using wrong case (month)', - id: 'freshness-expires-wrong-case-month', - kind: 'optimal', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18 AUG 2050 02:01:18 GMT', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a response with a future `Expires` using wrong case (tz)', - id: 'freshness-expires-wrong-case-tz', - kind: 'optimal', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18 Aug 2050 02:01:18 gMT', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (UTC)', - id: 'freshness-expires-invalid-utc', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18 Aug 2050 02:01:18 UTC', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (other tz)', - id: 'freshness-expires-invalid-aest', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18 Aug 2050 02:01:18 AEST', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (two-digit year)', - id: 'freshness-expires-invalid-2-digit-year', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18 Aug 50 02:01:18 GMT', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (missing comma)', - id: 'freshness-expires-invalid-no-comma', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu 18 Aug 2050 02:01:18 GMT', false], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (multiple spaces)', - id: 'freshness-expires-invalid-multiple-spaces', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18 Aug 2050 02:01:18 GMT', false], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (date dashes)', - id: 'freshness-expires-invalid-date-dashes', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18-Aug-2050 02:01:18 GMT', false], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (time periods)', - id: 'freshness-expires-invalid-time-periods', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18 Aug 2050 02.01.18 GMT', false], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (1-digit hour)', - id: 'freshness-expires-invalid-1-digit-hour', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18 Aug 2050 2:01:18 GMT', false], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse a response with an invalid `Expires` (multiple lines)', - id: 'freshness-expires-invalid-multiple-lines', - depends_on: ['freshness-expires-future'], - requests: [ - { - response_headers: [ - ['Expires', 'Thu, 18 Aug 2050 2:01:18 GMT', false], - ['Expires', 'Thu, 18 Aug 2050 2:01:19 GMT', false], - ['Date', 0] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/headers.mjs b/test/fixtures/cache-tests/tests/headers.mjs deleted file mode 100644 index e27aee2a98f..00000000000 --- a/test/fixtures/cache-tests/tests/headers.mjs +++ /dev/null @@ -1,77 +0,0 @@ -import * as templates from './lib/templates.mjs' -import * as utils from './lib/utils.mjs' -import headerList from './lib/header-list.mjs' - -const tests = [] - -tests.push({ - name: '`Connection` header must inhibit a HTTP cache from storing listed headers', - id: 'headers-omit-headers-listed-in-Connection', - kind: 'required', - depends_on: ['freshness-max-age'], - requests: [ - templates.fresh({ - response_headers: [ - ['Connection', 'a, b', false], - ['a', '1', false], - ['b', '2', false], - ['c', '3', false] - ] - }), - { - expected_type: 'cached', - expected_response_headers: [['c', '3']], - expected_response_headers_missing: ['a', 'b'], - setup_tests: ['expected_type', 'expected_response_headers'] - } - ] -}) - -function checkStoreHeader (config) { - const id = `store-${config.name}` - const value = 'valB' in config ? config.valB : utils.httpContent(`${config.name}-store-value`) - const storeHeader = 'noStore' in config ? !config.noStore : true - const requirement = storeHeader ? 'must' : 'must not' - const expectedHeaders = storeHeader ? [[config.name, value]] : [] - const unexpectedHeaders = storeHeader ? [] : [[config.name, value]] - - const respHeaders = [ - ['Date', 0], - [config.name, value, storeHeader] - ] - if (config.name !== 'Cache-Control') { - respHeaders.push(['Cache-Control', 'max-age=3600']) - } - - tests.push({ - name: `HTTP cache ${requirement} store \`${config.name}\` header field`, - id: `headers-${id}`, - kind: 'required', - depends_on: ['freshness-max-age'], - requests: [ - { - response_headers: respHeaders, - setup: true, - pause_after: true, - check_body: 'checkBody' in config ? config.checkBody : true - }, - { - expected_type: 'cached', - expected_response_headers: expectedHeaders, - expected_response_headers_missing: unexpectedHeaders, - setup_tests: ['expected_type'], - check_body: 'checkBody' in config ? config.checkBody : true - } - ] - }) -} - -headerList.forEach(checkStoreHeader) - -export default { - name: 'Storing Header Fields', - id: 'headers', - description: 'These tests examine how caches store headers in responses.', - spec_anchors: ['storing.fields'], - tests -} diff --git a/test/fixtures/cache-tests/tests/heuristic-freshness.mjs b/test/fixtures/cache-tests/tests/heuristic-freshness.mjs deleted file mode 100644 index 9b0c3600069..00000000000 --- a/test/fixtures/cache-tests/tests/heuristic-freshness.mjs +++ /dev/null @@ -1,95 +0,0 @@ -import * as utils from './lib/utils.mjs' - -const tests = [] - -function checkStatus (status) { - const succeed = status[0] - const code = status[1] - const phrase = status[2] - let body = status[3] - if (body === undefined) { - body = utils.httpContent(code) - } - const extra = status[4] || '' - const extraHdr = status[5] - const specAnchors = status[6] || [] - let expectedType = 'not_cached' - let desired = 'HTTP cache must not reuse' - if (succeed === true) { - expectedType = 'cached' - desired = 'An optimal HTTP cache should reuse' - } - const responseHeaders = [ - ['Last-Modified', -24 * 60 * 60], - ['Date', 0] - ] - if (extraHdr) { - responseHeaders.push(extraHdr) - } - tests.push({ - name: `${desired} a \`${code} ${phrase}\` response with \`Last-Modified\` based upon heuristic freshness ${extra}`, - id: `heuristic-${code}-${expectedType}`, - kind: succeed ? 'optimal' : 'required', - spec_anchors: specAnchors, - requests: [{ - response_status: [code, phrase], - response_headers: responseHeaders, - response_body: body, - setup: true - }, { - expected_type: expectedType, - response_status: [code, phrase], - response_body: body - }] - }) -} - -[ - [true, 200, 'OK'], - [false, 201, 'Created'], - [false, 202, 'Accepted'], - [true, 203, 'Non-Authoritative Information'], - [true, 204, 'No Content', null], - [false, 403, 'Forbidden'], - [true, 404, 'Not Found'], - [true, 405, 'Method Not Allowed'], - [true, 410, 'Gone'], - [true, 414, 'URI Too Long'], - [true, 501, 'Not Implemented'], - [false, 502, 'Bad Gateway'], - [false, 503, 'Service Unavailable'], - [false, 504, 'Gateway Timeout'], - [false, 599, 'Unknown', undefined, 'when `Cache-Control: public` is not present', undefined, ['cache-response-directive.public']], - [true, 599, 'Unknown', undefined, 'when `Cache-Control: public` is present', ['Cache-Control', 'public'], ['cache-response-directive.public']] -].forEach(checkStatus) - -function checkHeuristic (delta) { - tests.push({ - name: `Does HTTP cache consider a \`Last-Modified\` ${delta} seconds ago heuristically fresh?`, - id: `heuristic-delta-${delta}`, - kind: 'check', - requests: [{ - response_headers: [ - ['Last-Modified', -delta], - ['Date', 0] - ], - setup: true, - pause_after: true - }, - { - expected_type: 'cached' - }] - }) -} - -[ - 5, 10, 30, 60, 300, 600, 1200, 1800, 3600, 3600 * 12, 3600 * 24 -].forEach(checkHeuristic) - -export default { - name: 'Heuristic Freshness', - id: 'heuristic', - description: 'These tests check how caches handle heuristic freshness.', - spec_anchors: ['heuristic.freshness'], - tests -} diff --git a/test/fixtures/cache-tests/tests/index.mjs b/test/fixtures/cache-tests/tests/index.mjs deleted file mode 100644 index 1a79eff426f..00000000000 --- a/test/fixtures/cache-tests/tests/index.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import ccParse from './cc-parse.mjs' -import ccRequest from './cc-request.mjs' -import ccResponse from './cc-response.mjs' -import ccFreshness from './cc-freshness.mjs' -import ageParse from './age-parse.mjs' -import pragma from './pragma.mjs' -import expiresParse from './expires-parse.mjs' -import expires from './expires-freshness.mjs' -import stale from './stale.mjs' -import heuristic from './heuristic-freshness.mjs' -import methods from './method.mjs' -import statuses from './status.mjs' -import vary from './vary.mjs' -import varyParse from './vary-parse.mjs' -import conditionalLm from './conditional-lm.mjs' -import conditionalEtag from './conditional-etag.mjs' -import headers from './headers.mjs' -import update304 from './update304.mjs' -import updateHead from './updateHead.mjs' -import invalidation from './invalidation.mjs' -import partial from './partial.mjs' -import auth from './authorization.mjs' -import other from './other.mjs' -import cdncc from './cdn-cache-control.mjs' -import interim from './interim.mjs' - -export default [ccFreshness, ccParse, ageParse, expires, expiresParse, ccResponse, stale, heuristic, methods, statuses, ccRequest, pragma, vary, varyParse, conditionalLm, conditionalEtag, headers, update304, updateHead, invalidation, partial, auth, other, cdncc, interim] diff --git a/test/fixtures/cache-tests/tests/interim.mjs b/test/fixtures/cache-tests/tests/interim.mjs deleted file mode 100644 index 4ffb3139dd2..00000000000 --- a/test/fixtures/cache-tests/tests/interim.mjs +++ /dev/null @@ -1,124 +0,0 @@ -export default - -{ - name: 'Interim Response Handling', - id: 'interim', - description: 'These tests check how caches handle interim responses.', - tests: [ - { - name: 'An optimal HTTP cache passes a 102 response through and caches the final response', - id: 'interim-102', - browser_skip: true, // Fetch API in browsers don't expose interim responses - kind: 'optimal', - requests: [ - { - interim_responses: [[102]], - expected_interim_responses: [[102]], - response_headers: [ - ['Cache-Control', 'max-age=100000'], - ['Date', 0] - ], - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache passes a 103 response through and caches the final response', - id: 'interim-103', - browser_skip: true, - kind: 'optimal', - requests: [ - { - interim_responses: [ - [103, [ - ['link', '; rel=preload; as=style'], - ['x-my-header', 'test'] - ]] - ], - expected_interim_responses: [ - [103, [ - ['link', '; rel=preload; as=style'], - ['x-my-header', 'test'] - ]] - ], - response_headers: [ - ['Cache-Control', 'max-age=100000'], - ['Date', 0] - ], - pause_after: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'An HTTP cache should not cache non-final responses', - id: 'interim-not-cached', - browser_skip: true, - kind: 'required', - requests: [ - { - interim_responses: [ - [103, [ - ['link', '; rel=preload; as=style'] - ]] - ], - expected_interim_responses: [ - [103, [ - ['link', '; rel=preload; as=style'] - ]] - ], - response_headers: [ - ['Cache-Control', 'max-age=100000'], - ['Date', 0] - ], - pause_after: true - }, - { - expected_type: 'cached', - expected_interim_responses: [] - } - ] - }, - { - name: 'An optimal HTTP cache should not store headers from non-final responses', - id: 'interim-no-header-reuse', - browser_skip: true, - kind: 'optimal', - requests: [ - { - interim_responses: [ - [103, [ - ['link', '; rel=preload; as=style'], - ['x-my-header', 'test'] - ]] - ], - expected_interim_responses: [ - [103, [ - ['link', '; rel=preload; as=style'], - ['x-my-header', 'test'] - ]] - ], - response_headers: [ - ['Cache-Control', 'max-age=100000'], - ['Date', 0] - ], - expected_response_headers_missing: [ - 'x-my-header' - ], - pause_after: true - }, - { - expected_type: 'cached', - expected_response_headers_missing: [ - 'x-my-header' - ] - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/invalidation.mjs b/test/fixtures/cache-tests/tests/invalidation.mjs deleted file mode 100644 index 8ed8c7e46ec..00000000000 --- a/test/fixtures/cache-tests/tests/invalidation.mjs +++ /dev/null @@ -1,121 +0,0 @@ -import { makeTemplate, fresh } from './lib/templates.mjs' - -const contentLocation = makeTemplate({ - filename: 'content_location_target', - response_headers: [ - ['Cache-Control', 'max-age=100000'], - ['Last-Modified', 0], - ['Date', 0] - ] -}) - -const location = makeTemplate({ - filename: 'location_target', - response_headers: [ - ['Cache-Control', 'max-age=100000'], - ['Last-Modified', 0], - ['Date', 0] - ] -}) - -const lclResponse = makeTemplate({ - response_headers: [ - ['Location', 'location_target'], - ['Content-Location', 'content_location_target'] - ], - magic_locations: true -}) - -const tests = [] - -function checkInvalidation (method) { - tests.push({ - name: `HTTP cache must invalidate the URL after a successful response to a \`${method}\` request`, - id: `invalidate-${method}`, - depends_on: ['freshness-max-age'], - requests: [ - fresh({}), { - request_method: method, - request_body: 'abc', - setup: true - }, { - expected_type: 'not_cached' - } - ] - }) - tests.push({ - name: `An optimal HTTP cache does not invalidate the URL after a failed response to a \`${method}\` request`, - id: `invalidate-${method}-failed`, - kind: 'optimal', - depends_on: [`invalidate-${method}`], - requests: [ - fresh({}), { - request_method: method, - request_body: 'abc', - response_status: [500, 'Internal Server Error'], - setup: true - }, { - expected_type: 'cached' - } - ] - }) -} - -function checkLocationInvalidation (method) { - tests.push({ - name: `Does HTTP cache invalidate \`Location\` URL after a successful response to a \`${method}\` request?`, - id: `invalidate-${method}-location`, - kind: 'check', - depends_on: [`invalidate-${method}`], - requests: [ - location({ - setup: true - }), lclResponse({ - request_method: method, - request_body: 'abc', - setup: true - }), location({ - expected_type: 'not_cached' - }) - ] - }) -} - -function checkClInvalidation (method) { - tests.push({ - name: `Does HTTP cache must invalidate \`Content-Location\` URL after a successful response to a \`${method}\` request?`, - id: `invalidate-${method}-cl`, - kind: 'check', - depends_on: [`invalidate-${method}`], - requests: [ - contentLocation({ - setup: true - }), lclResponse({ - request_method: method, - request_body: 'abc', - setup: true - }), contentLocation({ - expected_type: 'not_cached' - }) - ] - }) -} - -const methods = [ - 'POST', - 'PUT', - 'DELETE', - 'M-SEARCH' -] - -methods.forEach(checkInvalidation) -methods.forEach(checkLocationInvalidation) -methods.forEach(checkClInvalidation) - -export default { - name: 'Cache Invalidation', - id: 'invalidation', - description: 'These tests check how caches support invalidation, including when it is triggered by the `Location` and `Content-Location` response headers.', - spec_anchors: ['invalidation'], - tests -} diff --git a/test/fixtures/cache-tests/tests/lib/header-list.mjs b/test/fixtures/cache-tests/tests/lib/header-list.mjs deleted file mode 100644 index dcdf3a253e0..00000000000 --- a/test/fixtures/cache-tests/tests/lib/header-list.mjs +++ /dev/null @@ -1,135 +0,0 @@ -export default [ - { - name: 'Test-Header', - reqUpdate: true - }, - { - name: 'X-Test-Header', - reqUpdate: true - }, - { - name: 'Content-Foo', - reqUpdate: true - }, - { - name: 'X-Content-Foo', - reqUpdate: true - }, - { - name: 'Cache-Control', - valA: 'max-age=1', - valB: 'max-age=3600', - reqUpdate: true - }, - { - name: 'Connection', - noStore: true - }, - { - name: 'Content-Encoding' - }, - { - name: 'Content-Length', - valA: '36', - valB: '10', - noUpdate: true, - checkBody: false - }, - { - name: 'Content-Location', - valA: '/foo', - valB: '/bar' - }, - { - name: 'Content-MD5', - valA: 'rL0Y20zC+Fzt72VPzMSk2A==', - valB: 'N7UdGUp1E+RbVvZSTy1R8g==' - }, - { - name: 'Content-Range' - }, - { - name: 'Content-Security-Policy', - valA: 'default-src \'self\'', - valB: 'default-src \'self\' cdn.example.com' - }, - { - name: 'Content-Type', - valA: 'text/plain', - valB: 'text/plain;charset=utf-8' - }, - { - name: 'Clear-Site-Data', - valA: 'cache', - valB: 'cookies' - }, - { - name: 'ETag', - valA: '"abcdef"', - valB: '"ghijkl"' - }, - { - name: 'Expires', - valA: 'Fri, 01 Jan 2038 01:01:01 GMT', - valB: 'Mon, 11 Jan 2038 11:11:11 GMT' - }, - { - name: 'Keep-Alive', - noStore: true - }, - { - name: 'Proxy-Authenticate', - noStore: true - }, - { - name: 'Proxy-Authentication-Info', - noStore: true - }, - { - name: 'Proxy-Authorization', - noStore: true - }, - { - name: 'Proxy-Connection', - noStore: true - }, - { - name: 'Public-Key-Pins' - }, - { - name: 'Set-Cookie', - valA: 'a=b', - valB: 'a=c' - }, - { - name: 'Set-Cookie2', - valA: 'a=b', - valB: 'a=c' - }, - { - name: 'TE', - noStore: true - }, - // { - // name: 'Trailer', - // noStore: true - // }, - { - name: 'Transfer-Encoding', - noStore: true - }, - { - name: 'Upgrade', - noStore: true - }, - { - name: 'X-Frame-Options', - valA: 'deny', - valB: 'sameorigin' - }, - { - name: 'X-XSS-Protection', - valA: '1', - valB: '1; mode=block' - } -] diff --git a/test/fixtures/cache-tests/tests/lib/templates.mjs b/test/fixtures/cache-tests/tests/lib/templates.mjs deleted file mode 100644 index 914b97b45c0..00000000000 --- a/test/fixtures/cache-tests/tests/lib/templates.mjs +++ /dev/null @@ -1,74 +0,0 @@ -/* -makeTemplate(template) - -templates take an optional request object; the template -will be updated with the request object in the following manner: - -- Object members will be assigned from the request -- Array members will be concatenated from the request -- Other members will be updated from the request -*/ -export function makeTemplate (template) { - return function (request) { - return mergeDeep({}, template, request) - } -} - -function isObject (item) { - return (item && typeof item === 'object' && !Array.isArray(item)) -} - -function mergeDeep (target, ...sources) { - if (!sources.length) return target - const source = sources.shift() - - if (isObject(target) && isObject(source)) { - for (const key in source) { - if (isObject(source[key])) { - if (!target[key]) Object.assign(target, { [key]: {} }) - mergeDeep(target[key], source[key]) - } else if (Array.isArray(source[key])) { - if (!target[key]) Object.assign(target, { [key]: [] }) - Object.assign(target, { [key]: target[key].concat(source[key]) }) - } else { - Object.assign(target, { [key]: source[key] }) - } - } - } - - return mergeDeep(target, ...sources) -} - -/* - Templates below are shared between multiple suites; - suite-specific tests should go in that file. -*/ - -export const fresh = makeTemplate({ - response_headers: [ - ['Cache-Control', 'max-age=100000'], - ['Date', 0] - ], - setup: true, - pause_after: true -}) - -export const stale = makeTemplate({ - response_headers: [ - ['Expires', -5000], - ['Last-Modified', -100000], - ['Date', 0] - ], - setup: true, - pause_after: true -}) - -export const becomeStale = makeTemplate({ - response_headers: [ - ['Cache-Control', 'max-age=2'], - ['Date', 0], - ['Template-A', '1'] - ], - setup: true, - pause_after: true -}) diff --git a/test/fixtures/cache-tests/tests/lib/utils.mjs b/test/fixtures/cache-tests/tests/lib/utils.mjs deleted file mode 100644 index affe7a3614f..00000000000 --- a/test/fixtures/cache-tests/tests/lib/utils.mjs +++ /dev/null @@ -1,20 +0,0 @@ -const contentSeed = 1 -const contentStore = {} -export function httpContent (csKey, contentLength = 15) { - if (csKey in contentStore) { - return contentStore[csKey] - } else { - let keySeed = 0 - for (let i = 0; i < csKey.length; i++) { - keySeed += csKey.charCodeAt(i) - } - const contents = [] - for (let i = 0; i < contentLength; ++i) { - const idx = ((i * keySeed * contentSeed) % 26) + 97 - contents.push(String.fromCharCode(idx)) - } - const content = contents.join('') - contentStore[csKey] = content - return content - } -} diff --git a/test/fixtures/cache-tests/tests/method.mjs b/test/fixtures/cache-tests/tests/method.mjs deleted file mode 100644 index 31b24094eaa..00000000000 --- a/test/fixtures/cache-tests/tests/method.mjs +++ /dev/null @@ -1,35 +0,0 @@ -export default - -{ - name: 'Method-related Caching Requirements', - id: 'method', - description: 'These tests check how caches handle different HTTP methods.', - spec_anchors: ['response.cacheability'], - tests: [ - { - name: 'An optimal HTTP cache reuses a stored `POST` response (that has `Content-Location` with the same URL and explicit freshness) for subsequent `GET` requests', - id: 'method-POST', - kind: 'optimal', - requests: [ - { - request_method: 'POST', - request_body: '12345', - request_headers: [ - ['Content-Type', 'text/plain'] - ], - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Content-Location', ''], - ['Date', 0] - ], - magic_locations: true, - pause_after: true, - setup: true - }, - { - expected_type: 'cached' - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/other.mjs b/test/fixtures/cache-tests/tests/other.mjs deleted file mode 100644 index 6e8464251a0..00000000000 --- a/test/fixtures/cache-tests/tests/other.mjs +++ /dev/null @@ -1,239 +0,0 @@ -import * as templates from './lib/templates.mjs' -import * as utils from './lib/utils.mjs' - -export default - -{ - name: 'Other Caching Requirements', - id: 'other', - description: 'These tests check miscellaneous HTTP cache behaviours. ', - tests: [ - { - name: 'HTTP cache must generate an `Age` header field when using a stored response.', - id: 'other-age-gen', - depends_on: ['freshness-max-age'], - spec_anchors: ['field.age', 'constructing.responses.from.caches'], - requests: [ - templates.fresh({}), - { - expected_type: 'cached', - expected_response_headers: [ - ['Age', '>', 2] - ] - } - ] - }, - { - name: 'Does HTTP cache insert an `Age` header field when there is delay generating the response?', - id: 'other-age-delay', - kind: 'check', - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Date', 0] - ], - response_pause: 5, - expected_response_headers: [['age', '>', 0]] - } - ] - }, - { - name: 'HTTP cache must update the `Age` header field when freshness is based upon `Expires`', - id: 'other-age-update-expires', - depends_on: ['freshness-expires-future'], - spec_anchors: ['constructing.responses.from.caches', 'field.age'], - requests: [ - { - response_headers: [ - ['Expires', 30 * 24 * 60 * 60], - ['Date', 0], - ['Age', '30'] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached', - expected_response_headers: [ - ['Age', '>', 32] - ] - } - ] - }, - { - name: 'HTTP cache must update the `Age` header field when freshness is based upon `CC: max-age`', - id: 'other-age-update-max-age', - depends_on: ['freshness-max-age'], - spec_anchors: ['constructing.responses.from.caches', 'field.age'], - requests: [ - templates.fresh({ - response_headers: [ - ['Age', '30'] - ] - }), - { - expected_type: 'cached', - expected_response_headers: [ - ['Age', '>', 32] - ] - } - ] - }, - { - name: 'HTTP cache must not update the `Date` header field', - id: 'other-date-update', - depends_on: ['freshness-max-age'], - spec_anchors: ['field.date'], - requests: [ - templates.fresh({}), - { - expected_type: 'cached', - expected_response_headers: [ - ['Date', 0] - ] - } - ] - }, - { - name: 'HTTP cache must not update the `Date` header field when `Expires` is present', - id: 'other-date-update-expires', - depends_on: ['freshness-expires-future'], - spec_anchors: ['field.date'], - requests: [ - { - response_headers: [ - ['Expires', 30 * 24 * 60 * 60], - ['Date', 0] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached', - expected_response_headers: [ - ['Date', 0] - ] - } - ] - }, - { - name: 'Does HTTP cache leave the `Expires` header field alone?', - id: 'other-date-update-expires-update', - kind: 'check', - depends_on: ['freshness-expires-future'], - spec_anchors: ['field.date'], - requests: [ - { - response_headers: [ - ['Expires', 30 * 24 * 60 * 60], - ['Date', 0] - ], - pause_after: true, - setup: true - }, - { - expected_type: 'cached', - expected_response_headers: [ - ['Expires', 30 * 24 * 60 * 60] - ] - } - ] - }, - { - name: 'Different query arguments must be different cache keys', - id: 'query-args-different', - depends_on: ['freshness-max-age'], - requests: [ - templates.fresh({ - query_arg: 'test=' + utils.httpContent('query-args-different-1') - }), - { - query_arg: 'test=' + utils.httpContent('query-args-different-2'), - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache should not be affected by the presence of a URL query', - id: 'query-args-same', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - templates.fresh({ - query_arg: 'test=' + utils.httpContent('query-args-same') - }), - { - query_arg: 'test=' + utils.httpContent('query-args-same'), - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP heuristically cache a response with a `Content-Disposition: attachment` header?', - id: 'other-heuristic-content-disposition-attachment', - kind: 'check', - depends_on: ['heuristic-200-cached'], - requests: [ - { - response_headers: [ - ['Last-Modified', -100000], - ['Date', 0], - ['Content-Disposition', 'attachment; filename=example.txt'] - ], - setup: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP reuse a fresh response with a `Content-Disposition: attachment` header?', - id: 'other-fresh-content-disposition-attachment', - kind: 'check', - depends_on: ['freshness-max-age'], - requests: [ - templates.fresh({ - response_headers: [ - ['Content-Disposition', 'attachment; filename=example.txt'] - ] - }), - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a fresh response with a `Set-Cookie` header', - id: 'other-set-cookie', - depends_on: ['freshness-max-age'], - kind: 'optimal', - requests: [ - templates.fresh({ - response_headers: [ - ['Set-Cookie', 'a=b'] - ] - }), - { - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a fresh response when the request has a `Cookie` header', - id: 'other-cookie', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - templates.fresh({}), - { - request_headers: [ - ['Cookie', 'a=b'] - ], - expected_type: 'cached' - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/partial.mjs b/test/fixtures/cache-tests/tests/partial.mjs deleted file mode 100644 index 5b3f4f5de3a..00000000000 --- a/test/fixtures/cache-tests/tests/partial.mjs +++ /dev/null @@ -1,271 +0,0 @@ -export default { - name: 'Combining Partial Content', - id: 'partial', - description: 'These tests check how caches handle partial content (also known as `Range` requests).', - spec_anchors: ['combining.responses'], - tests: [ - { - name: 'An optimal HTTP cache stores partial content and reuses it', - id: 'partial-store-partial-reuse-partial', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - { - request_headers: [ - ['Range', 'bytes=-5'] - ], - response_status: [206, 'Partial Content'], - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Content-Range', 'bytes 4-9/10'] - ], - response_body: '01234', - expected_request_headers: [ - ['Range', 'bytes=-5'] - ], - setup: true - }, - { - request_headers: [ - ['Range', 'bytes=-5'] - ], - expected_type: 'cached', - expected_status: 206, - expected_response_text: '01234' - } - ] - }, - { - name: 'An optimal HTTP cache stores complete responses and serves smaller ranges from them (byte-range-spec)', - id: 'partial-store-complete-reuse-partial', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'] - ], - response_body: '01234567890', - setup: true - }, - { - request_headers: [ - ['Range', 'bytes=0-1'] - ], - expected_type: 'cached', - expected_status: 206, - expected_response_text: '01' - } - ] - }, - { - name: 'An optimal HTTP cache stores complete responses and serves smaller ranges from them (absent last-byte-pos)', - id: 'partial-store-complete-reuse-partial-no-last', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'] - ], - response_body: '01234567890', - setup: true - }, - { - request_headers: [ - ['Range', 'bytes=1-'] - ], - expected_type: 'cached', - expected_status: 206, - expected_response_text: '1234567890' - } - ] - }, - { - name: 'An optimal HTTP cache stores complete responses and serves smaller ranges from them (suffix-byte-range-spec)', - id: 'partial-store-complete-reuse-partial-suffix', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'] - ], - response_body: '0123456789A', - setup: true - }, - { - request_headers: [ - ['Range', 'bytes=-1'] - ], - expected_type: 'cached', - expected_status: 206, - expected_response_text: 'A' - } - ] - }, - { - name: 'An optimal HTTP cache stores partial responses and serves smaller ranges from them (byte-range-spec)', - id: 'partial-store-partial-reuse-partial-byterange', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - { - request_headers: [ - ['Range', 'bytes=-5'] - ], - response_status: [206, 'Partial Content'], - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Content-Range', 'bytes 4-9/10'] - ], - response_body: '01234', - setup: true - }, - { - request_headers: [ - ['Range', 'bytes=6-8'] - ], - expected_type: 'cached', - expected_status: 206, - expected_response_text: '234' - } - ] - }, - { - name: 'An optimal HTTP cache stores partial responses and serves smaller ranges from them (absent last-byte-pos)', - id: 'partial-store-partial-reuse-partial-absent', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - { - request_headers: [ - ['Range', 'bytes=-5'] - ], - response_status: [206, 'Partial Content'], - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Content-Range', 'bytes 4-9/10'] - ], - response_body: '01234', - setup: true - }, - { - request_headers: [ - ['Range', 'bytes=6-'] - ], - expected_type: 'cached', - expected_status: 206, - expected_response_text: '234' - } - ] - }, - { - name: 'An optimal HTTP cache stores partial responses and serves smaller ranges from them (suffix-byte-range-spec)', - id: 'partial-store-partial-reuse-partial-suffix', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - { - request_headers: [ - ['Range', 'bytes=-5'] - ], - response_status: [206, 'Partial Content'], - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Content-Range', 'bytes 4-9/10'] - ], - response_body: '01234', - setup: true - }, - { - request_headers: [ - ['Range', 'bytes=-1'] - ], - expected_type: 'cached', - expected_status: 206, - expected_response_text: '4' - } - ] - }, - { - name: 'An optimal HTTP cache stores partial content and completes it', - id: 'partial-store-partial-complete', - kind: 'optimal', - depends_on: ['freshness-max-age'], - requests: [ - { - request_headers: [ - ['Range', 'bytes=-5'] - ], - response_status: [206, 'Partial Content'], - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Content-Range', 'bytes 0-4/10'] - ], - response_body: '01234', - setup: true - }, - { - expected_request_headers: [ - ['range', 'bytes=5-'] - ] - } - ] - }, - { - name: 'HTTP cache must use header fields from the new response', - id: 'partial-use-headers', - depends_on: ['partial-store-complete-reuse-partial'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['A', '1'] - ], - response_body: '01234567890', - setup: true - }, - { - request_headers: [ - ['Range', 'bytes=0-1'] - ], - expected_type: 'cached', - expected_status: 206, - expected_response_text: '01', - setup_tests: ['expected_type', 'expected_status', 'expected_response_text'], - response_headers: [ - ['A', '2'] - ] - } - ] - }, - { - name: 'HTTP cache must preserve unupdated header fields from the stored response', - id: 'partial-use-stored-headers', - depends_on: ['partial-store-complete-reuse-partial'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['A', '1'] - ], - response_body: '01234567890', - setup: true - }, - { - request_headers: [ - ['Range', 'bytes=0-1'] - ], - expected_type: 'cached', - expected_status: 206, - expected_response_text: '01', - setup_tests: ['expected_type', 'expected_status', 'expected_response_text'], - expected_response_headers: [ - ['A', '1'] - ] - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/pragma.mjs b/test/fixtures/cache-tests/tests/pragma.mjs deleted file mode 100644 index 0ced90bb203..00000000000 --- a/test/fixtures/cache-tests/tests/pragma.mjs +++ /dev/null @@ -1,97 +0,0 @@ -import * as templates from './lib/templates.mjs' - -export default - -{ - name: 'Pragma', - id: 'pragma', - description: 'These tests check how caches handle the deprecated `Pragma` header in reqeusts and responses. Note that This field is deprecated - it is not required to be supported.', - spec_anchors: ['field.pragma'], - tests: [ - { - name: 'Does HTTP cache use a stored fresh response when request contains `Pragma: no-cache`?', - id: 'pragma-request-no-cache', - kind: 'check', - depends_on: ['freshness-max-age'], - requests: [ - templates.fresh({}), - { - request_headers: [ - ['Pragma', 'no-cache'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a stored fresh response when request contains `Pragma: unrecognised-extension`?', - id: 'pragma-request-extension', - kind: 'check', - depends_on: ['freshness-max-age'], - requests: [ - templates.fresh({}), - { - request_headers: [ - ['Pragma', 'unrecognised-extension'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a stored and otherwise fresh response when it contains `Pragma: no-cache`?', - id: 'pragma-response-no-cache', - kind: 'check', - depends_on: ['freshness-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Pragma', 'no-cache'] - ], - setup: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache reuse a stored and heuristically fresh response when it contains `Pragma: no-cache`?', - id: 'pragma-response-no-cache-heuristic', - kind: 'check', - depends_on: ['heuristic-200-cached'], - requests: [ - { - response_headers: [ - ['Date', 0], - ['Last-Modified', -10000], - ['Pragma', 'no-cache'] - ], - setup: true - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache use a stored and otherwise fresh response when it contains `Pragma: unrecognised-extension`?', - id: 'pragma-response-extension', - kind: 'check', - depends_on: ['freshness-max-age'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=3600'], - ['Pragma', 'unrecognised-extension'] - ], - setup: true - }, - { - expected_type: 'cached' - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/stale.mjs b/test/fixtures/cache-tests/tests/stale.mjs deleted file mode 100644 index dfa9dcecf0c..00000000000 --- a/test/fixtures/cache-tests/tests/stale.mjs +++ /dev/null @@ -1,183 +0,0 @@ -import * as templates from './lib/templates.mjs' - -function makeStaleCheckCC (cc, sharedOnly, value) { - const shared = sharedOnly === true ? 'Shared ' : '' - return { - name: `${shared}HTTP cache must not serve stale stored response when prohibited by \`Cache-Control: ${cc}\``, - id: `stale-close-${cc}${value || ''}`, - browser_skip: sharedOnly, - depends_on: ['stale-close'], - spec_anchors: [`cache-response-directive.${cc}`], - requests: [ - { - response_headers: [ - ['Cache-Control', `max-age=2, ${cc}${value || ''}`] - ], - setup: true, - pause_after: true - }, - { - disconnect: true, - expected_status: null, - check_body: false, - expected_response_headers_missing: ['server-request-count'] - } - ] - } -} - -export default { - name: 'Serving Stale', - id: 'stale', - description: 'These tests check how caches serve stale content.', - spec_anchors: ['serving.stale.responses'], - tests: [ - { - name: 'Does HTTP cache serve stale stored response when server closes the connection?', - id: 'stale-close', - depends_on: ['freshness-max-age-stale'], - kind: 'check', - requests: [ - templates.becomeStale({}), - { - disconnect: true, - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache serve stale stored response when server sends a `503 Service Unavailable`?', - id: 'stale-503', - depends_on: ['freshness-max-age-stale'], - kind: 'check', - requests: [ - templates.becomeStale({}), - { - response_status: [503, 'Service Unavailable'], - expected_status: 200, - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal cache serves stale stored response with [`Cache-Control: stale-while-revalidate`](https://httpwg.org/specs/rfc5861.html)', - id: 'stale-while-revalidate', - depends_on: ['freshness-max-age-stale'], - kind: 'optimal', - requests: [ - { - setup: true, - pause_after: true, - response_headers: [ - ['Cache-Control', 'max-age=1, stale-while-revalidate=3600'], - ['ETag', '"abc"'] - ] - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not serve stale stored response after the [`stale-while-revalidate`](https://httpwg.org/specs/rfc5861.html) window', - id: 'stale-while-revalidate-window', - depends_on: ['stale-while-revalidate'], - requests: [ - { - setup: true, - pause_after: true, - response_headers: [ - ['Cache-Control', 'max-age=1, stale-while-revalidate=4'], - ['ETag', '"abc"'] - ] - }, - { - setup: true, - pause_after: true, - response_headers: [ - ['Cache-Control', 'no-cache', false], - ['ETag', '"def"', false] - ], - expected_type: 'cached' - }, - { - expected_response_headers: [ - ['client-request-count', '3'] - ] - } - ] - }, - { - name: 'Does HTTP cache serve stale stored response when server sends `Cache-Control: stale-if-error` and subsequently closes the connection?', - id: 'stale-sie-close', - depends_on: ['freshness-max-age-stale'], - kind: 'check', - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=2, stale-if-error=60'] - ], - setup: true, - pause_after: true - }, - { - disconnect: true, - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache serve stale stored response when server sends `Cache-Control: stale-if-error` and subsequently a `503 Service Unavailable`?', - id: 'stale-sie-503', - depends_on: ['freshness-max-age-stale'], - kind: 'check', - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=2, stale-if-error=60'] - ], - setup: true, - pause_after: true - }, - { - disconnect: true, - expected_type: 'cached' - } - ] - }, - makeStaleCheckCC('must-revalidate', false), - makeStaleCheckCC('proxy-revalidate', true), - makeStaleCheckCC('no-cache', false), - makeStaleCheckCC('s-maxage', true, '=2'), - { - name: 'Does HTTP cache generate a `Warning` header when using a response that was stored already stale?', - id: 'stale-warning-stored', - kind: 'check', - depends_on: ['stale-close'], - requests: [ - templates.stale({}), - { - disconnect: true, - expected_type: 'cached', - expected_response_headers: ['warning'], - setup_tests: ['expected_type'] - } - ] - }, - { - name: 'Does HTTP cache generate a `Warning` header when using a stored response that became stale?', - id: 'stale-warning-become', - kind: 'check', - depends_on: ['stale-close'], - requests: [ - templates.becomeStale({}), - { - disconnect: true, - expected_type: 'cached', - expected_response_headers: ['warning'], - setup_tests: ['expected_type'] - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/status.mjs b/test/fixtures/cache-tests/tests/status.mjs deleted file mode 100644 index e485056ea4b..00000000000 --- a/test/fixtures/cache-tests/tests/status.mjs +++ /dev/null @@ -1,118 +0,0 @@ -import * as templates from './lib/templates.mjs' -import * as utils from './lib/utils.mjs' - -const tests = [] - -function checkStatus (status) { - const code = status[0] - const phrase = status[1] - let body = status[2] - if (body === undefined) { - body = utils.httpContent(code) - } - const is3xx = code > 299 && code < 400 - tests.push({ - name: 'An optimal HTTP cache reuses a fresh `' + code + '` response with explict freshness', - id: `status-${code}-fresh`, - kind: 'optimal', - depends_on: ['freshness-max-age'], - browser_skip: is3xx, - requests: [ - templates.fresh({ - response_status: [code, phrase], - response_body: body, - redirect: 'manual' - }), { - expected_type: 'cached', - response_status: [code, phrase], - redirect: 'manual', - response_body: body - } - ] - }) - tests.push({ - name: 'HTTP cache must not reuse a stale `' + code + '` response with explicit freshness', - id: `status-${code}-stale`, - depends_on: [`status-${code}-fresh`], - browser_skip: is3xx, - requests: [ - templates.stale({ - response_status: [code, phrase], - response_body: body, - redirect: 'manual', - setup: true - }), { - expected_type: 'not_cached', - redirect: 'manual', - response_body: body - } - ] - }) -} -[ - [200, 'OK'], - [203, 'Non-Authoritative Information'], - [204, 'No Content', null], - [299, 'Whatever'], - [301, 'Moved Permanently'], - [302, 'Found'], - [303, 'See Other'], - [307, 'Temporary Redirect'], - [308, 'Permanent Redirect'], - [400, 'Bad Request'], - [404, 'Not Found'], - [410, 'Gone'], - [499, 'Whatever'], - [500, 'Internal Server Error'], - [502, 'Bad Gateway'], - [503, 'Service Unavailable'], - [504, 'Gateway Timeout'], - [599, 'Whatever'] -].forEach(checkStatus) - -tests.push({ - name: 'HTTP cache must not reuse a fresh response with an unrecognised status code and `Cache-Control: no-store, must-understand`', - id: 'status-599-must-understand', - depends_on: ['status-599-fresh'], - spec_anchors: ['cache-response-directive.must-understand'], - requests: [ - { - response_status: [599, 'Whatever'], - response_headers: [ - ['Cache-Control', 'max-age=3600, no-store, must-understand'] - ], - setup: true - }, - { - expected_type: 'not_cached' - } - ] -}) - -tests.push({ - name: 'An optimal HTTP cache reuses a fresh response with a recognised status code and `Cache-Control: no-store, must-understand`', - id: 'status-200-must-understand', - kind: 'optimal', - depends_on: ['status-200-fresh', 'cc-resp-no-store-fresh'], - spec_anchors: ['cache-response-directive.must-understand'], - requests: [ - { - response_status: [200, 'OK'], - response_headers: [ - ['Cache-Control', 'max-age=3600, no-store, must-understand'] - ], - setup: true - }, - { - expected_type: 'cached' - } - ] -}) - -export default { - name: 'Status Code Cacheability', - id: 'status', - description: 'These tests check to see if a cache will store and reuse various status codes when they have explicit freshness information associated with them.', - spec_anchors: ['response.cacheability'], - tests -} diff --git a/test/fixtures/cache-tests/tests/update304.mjs b/test/fixtures/cache-tests/tests/update304.mjs deleted file mode 100644 index b83f6d843f9..00000000000 --- a/test/fixtures/cache-tests/tests/update304.mjs +++ /dev/null @@ -1,124 +0,0 @@ -import * as utils from './lib/utils.mjs' -import headerList from './lib/header-list.mjs' - -const tests = [] - -// first, check to see that the cache actually returns a stored header -const storedHeader = 'Test-Header' -const valueA = utils.httpContent(`${storedHeader}-value-A`) -const lm1 = 'Wed, 01 Jan 2020 00:00:00 GMT' -tests.push({ - name: `HTTP cache must return stored \`${storedHeader}\` from a \`304\` that omits it`, - id: `304-lm-use-stored-${storedHeader}`, - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=2'], - ['Last-Modified', lm1], - ['Date', 0], - [storedHeader, valueA] - ], - setup: true, - pause_after: true - }, - { - response_headers: [ - ['Last-Modified', lm1], - ['Date', 0] - ], - expected_type: 'lm_validated', - expected_response_headers: [ - [storedHeader, valueA] - ], - setup_tests: ['expected_type'] - } - ] -}) - -// now check headers in the list -function check304 (config) { - if (config.noStore) return - config.valueA = config.valA || utils.httpContent(`${config.name}-value-A`) - config.valueB = config.valB || utils.httpContent(`${config.name}-value-B`) - if (config.noUpdate === true) { - config.expectedValue = config.valueA - config.requirement = 'HTTP cache must not' - config.punctuation = '' - config.kind = 'required' - } else if (config.reqUpdate === true) { - config.expectedValue = config.valueB - config.requirement = 'HTTP cache must' - config.punctuation = '' - config.kind = 'required' - } else { - config.expectedValue = config.valueB - config.requirement = 'Does HTTP cache' - config.punctuation = '?' - config.kind = 'check' - } - config.etagVal = utils.httpContent(`${config.name}-etag-1`) - config.etag = `"${config.etagVal}"` - config.lm = 'Wed, 01 Jan 2020 00:00:00 GMT' - - tests.push({ - name: `${config.requirement} update and return \`${config.name}\` from a \`304\`${config.punctuation}`, - id: `304-etag-update-response-${config.name}`, - kind: config.kind, - depends_on: [`304-lm-use-stored-${storedHeader}`], - requests: makeRequests(config, 'ETag', config.etag) - }) -} - -function makeRequests (config, validatorType, validatorValue) { - return [ - { - response_headers: makeResponse(config, config.valueA, validatorType, validatorValue), - setup: true, - pause_after: true, - check_body: 'checkBody' in config ? config.checkBody : true - }, - { - response_headers: makeResponse(config, config.valueB, validatorType, validatorValue), - expected_type: validatorType === 'ETag' ? 'etag_validated' : 'lm_validated', - setup_tests: ['expected_type'], - expected_response_headers: [ - [config.name, config.expectedValue] - ], - check_body: 'checkBody' in config ? config.checkBody : true - }, - { - response_headers: makeResponse(config, config.expectedValue), - expected_type: 'cached', - setup_tests: ['expected_type'], - expected_response_headers: [ - [config.name, config.expectedValue] - ], - check_body: 'checkBody' in config ? config.checkBody : true - } - ] -} - -function makeResponse (config, value, validatorType, validatorValue) { - const checkHeader = 'noUpdate' in config ? !config.noUpdate : true - const responseHeaders = [ - ['Date', 0], - [config.name, value, checkHeader] - ] - if (config.name !== 'Cache-Control') { - responseHeaders.push(['Cache-Control', 'max-age=2']) - } - if (validatorType && validatorType !== config.name) { - responseHeaders.push([validatorType, validatorValue]) - } - return responseHeaders -} - -headerList.forEach(check304) - -export default { - name: 'Update Headers Upon a 304', - id: 'update304', - description: 'These tests check cache behaviour upon receiving a `304 Not Modified` response.', - spec_anchors: ['freshening.responses'], - tests -} diff --git a/test/fixtures/cache-tests/tests/updateHead.mjs b/test/fixtures/cache-tests/tests/updateHead.mjs deleted file mode 100644 index 9b8998c8429..00000000000 --- a/test/fixtures/cache-tests/tests/updateHead.mjs +++ /dev/null @@ -1,109 +0,0 @@ -import * as templates from './lib/templates.mjs' - -export default - -{ - name: 'HEAD updates', - id: 'updateHEAD', - description: 'These tests check how a cache updates stored responses when receiving a `HEAD` response.', - spec_anchors: ['head.effects'], - tests: [ - { - name: 'Does HTTP cache write through a HEAD when stored response is stale?', - id: 'head-writethrough', - kind: 'check', - depends_on: ['freshness-max-age-stale'], - requests: [ - templates.becomeStale({}), - { - request_method: 'HEAD', - expected_method: 'HEAD' - } - ] - }, - { - name: 'Does HTTP cache preserve stored fields not received in a `200` response to a `HEAD`?', - id: 'head-200-retain', - kind: 'check', - depends_on: ['head-writethrough'], - requests: [ - templates.becomeStale({}), - { - request_method: 'HEAD', - expected_method: 'HEAD', - expected_response_headers: [ - ['Template-A', '1'] - ] - } - ] - }, - { - name: 'Does HTTP cache update freshness lifetime recieved in a `200` response to a `HEAD`?', - id: 'head-200-freshness-update', - kind: 'check', - depends_on: ['head-writethrough'], - requests: [ - templates.becomeStale({}), - { - request_method: 'HEAD', - expected_method: 'HEAD', - response_headers: [ - ['Cache-Control', 'max-age=1000'] - ] - }, - { - expected_type: 'cached' - } - ] - }, - { - name: 'Does HTTP cache update stored fields recieved in a `200` response to a `HEAD`?', - id: 'head-200-update', - kind: 'check', - depends_on: ['head-200-freshness-update'], - requests: [ - templates.becomeStale({}), - { - request_method: 'HEAD', - expected_method: 'HEAD', - response_headers: [ - ['Template-A', '2'], - ['Cache-Control', 'max-age=1000'] - ] - }, - { - expected_type: 'cached', - setup_tests: ['expected_type'], - expected_response_headers: [ - ['Template-A', '2'] - ] - } - ] - }, - { - name: 'Does HTTP cache update stored fields recieved in a `410` response to a `HEAD`?', - id: 'head-410-update', - kind: 'check', - depends_on: ['head-200-freshness-update'], - requests: [ - templates.becomeStale({}), - { - request_method: 'HEAD', - expected_method: 'HEAD', - response_status: [410, 'Gone'], - response_headers: [ - ['Template-A', '2'], - ['Cache-Control', 'max-age=1000'] - ] - }, - { - expected_type: 'cached', - setup_tests: ['expected_type'], - expected_response_headers: [ - ['Template-A', '2'] - ] - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/vary-parse.mjs b/test/fixtures/cache-tests/tests/vary-parse.mjs deleted file mode 100644 index b9bbe84b72d..00000000000 --- a/test/fixtures/cache-tests/tests/vary-parse.mjs +++ /dev/null @@ -1,158 +0,0 @@ -import { makeTemplate } from './lib/templates.mjs' - -const varyParseSetup = makeTemplate({ - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0] - ], - setup: true -}) - -export default { - name: 'Vary Parsing', - id: 'vary-parse', - description: 'These tests check how caches parse the `Vary` response header.', - spec_anchors: ['caching.negotiated.responses'], - tests: [ - { - name: 'HTTP cache must not reuse `Vary` response with a value of `*`', - id: 'vary-syntax-star', - depends_on: ['vary-match'], - requests: [ - varyParseSetup({ - response_headers: [ - ['Vary', '*', false] - ] - }), - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse `Vary` response with a value of `*, *`', - id: 'vary-syntax-star-star', - depends_on: ['vary-match'], - requests: [ - varyParseSetup({ - response_headers: [ - ['Vary', '*, *', false] - ] - }), - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse `Vary` response with a value of `*, *` on different lines', - id: 'vary-syntax-star-star-lines', - depends_on: ['vary-match'], - requests: [ - varyParseSetup({ - response_headers: [ - ['Vary', '*', false], - ['Vary', '*', false] - ] - }), - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse `Vary` response with a value of `, *`', - id: 'vary-syntax-empty-star', - depends_on: ['vary-match'], - requests: [ - varyParseSetup({ - response_headers: [ - ['Vary', ', *', false] - ] - }), - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse `Vary` response with a value of `, *` on different lines', - id: 'vary-syntax-empty-star-lines', - depends_on: ['vary-match'], - requests: [ - varyParseSetup({ - response_headers: [ - ['Vary', '', false], - ['Vary', '*', false] - ] - }), - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse `Vary` response with a value of `*, Foo`', - id: 'vary-syntax-star-foo', - depends_on: ['vary-match'], - requests: [ - varyParseSetup({ - response_headers: [ - ['Vary', '*, Foo', false] - ] - }), - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse `Vary` response with a value of `Foo, *`', - id: 'vary-syntax-foo-star', - depends_on: ['vary-match'], - requests: [ - varyParseSetup({ - response_headers: [ - ['Vary', 'Foo, *', false] - ] - }), - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - expected_type: 'not_cached' - } - ] - } - ] -} diff --git a/test/fixtures/cache-tests/tests/vary.mjs b/test/fixtures/cache-tests/tests/vary.mjs deleted file mode 100644 index 501b54800ee..00000000000 --- a/test/fixtures/cache-tests/tests/vary.mjs +++ /dev/null @@ -1,470 +0,0 @@ -import { makeTemplate } from './lib/templates.mjs' -import * as utils from './lib/utils.mjs' - -const varySetup = makeTemplate({ - request_headers: [ - ['Foo', '1'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Foo'] - ], - setup: true -}) - -const vary2Setup = makeTemplate({ - request_headers: [ - ['Foo', '1'], - ['Bar', 'abc'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Foo, Bar', false] - ], - setup: true -}) - -const vary3Setup = makeTemplate({ - request_headers: [ - ['Foo', '1'], - ['Bar', 'abc'], - ['Baz', '789'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Foo, Bar, Baz', false] - ], - setup: true -}) - -export default { - name: 'Vary and Cache Keys', - id: 'vary', - description: 'These tests check how caches calculate a cache key using `Vary`.', - spec_anchors: ['caching.negotiated.responses'], - tests: [ - { - name: 'An optimal HTTP cache reuses a `Vary` response when the request matches', - id: 'vary-match', - depends_on: ['freshness-max-age'], - kind: 'optimal', - requests: [ - varySetup({}), - { - request_headers: [ - ['Foo', '1'] - ], - expected_type: 'cached' - } - ] - }, - { - name: "HTTP cache must not reuse `Vary` response when request doesn't match", - id: 'vary-no-match', - depends_on: ['vary-match'], - requests: [ - varySetup({}), - { - request_headers: [ - ['Foo', '2'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse `Vary` response when stored request omits variant request header', - id: 'vary-omit-stored', - depends_on: ['vary-match'], - requests: [ - { - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Foo'] - ], - setup: true - }, - { - request_headers: [ - ['Foo', '1'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse `Vary` response when presented request omits variant request header', - id: 'vary-omit', - depends_on: ['vary-match'], - requests: [ - varySetup({}), - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache can store two different variants', - id: 'vary-invalidate', - depends_on: ['vary-match'], - kind: 'optimal', - requests: [ - varySetup({ - response_body: utils.httpContent('foo_1') - }), - { - request_headers: [ - ['Foo', '2'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Foo'] - ], - expected_type: 'not_cached', - response_body: utils.httpContent('foo_2'), - setup: true - }, - { - request_headers: [ - ['Foo', '1'] - ], - response_body: utils.httpContent('foo_1'), - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache should not include headers not listed in `Vary` in the cache key', - id: 'vary-cache-key', - depends_on: ['vary-match'], - kind: 'optimal', - requests: [ - varySetup({ - request_headers: [ - ['Other', '2'] - ] - }), - { - request_headers: [ - ['Foo', '1'], - ['Other', '3'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a two-way `Vary` response when request matches', - id: 'vary-2-match', - depends_on: ['vary-match'], - kind: 'optimal', - requests: [ - vary2Setup({}), - { - request_headers: [ - ['Foo', '1'], - ['Bar', 'abc'] - ], - expected_type: 'cached' - } - ] - }, - { - name: "HTTP cache must not reuse two-way `Vary` response when request doesn't match", - id: 'vary-2-no-match', - depends_on: ['vary-2-match'], - requests: [ - vary2Setup({}), - { - request_headers: [ - ['Foo', '2'], - ['Bar', 'abc'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'HTTP cache must not reuse two-way `Vary` response when request omits variant request header', - id: 'vary-2-match-omit', - depends_on: ['vary-2-match'], - requests: [ - vary2Setup({}), - { - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a three-way `Vary` response when request matches', - id: 'vary-3-match', - depends_on: ['vary-2-match'], - kind: 'optimal', - requests: [ - vary3Setup({}), - { - request_headers: [ - ['Foo', '1'], - ['Bar', 'abc'], - ['Baz', '789'] - ], - expected_type: 'cached' - } - ] - }, - { - name: "HTTP cache must not reuse three-way `Vary` response when request doesn't match", - id: 'vary-3-no-match', - depends_on: ['vary-3-match'], - requests: [ - vary3Setup({}), - { - request_headers: [ - ['Foo', '2'], - ['Bar', 'abc'], - ['Baz', '789'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: "HTTP cache must not reuse three-way `Vary` response when request doesn't match, regardless of header order", - id: 'vary-3-order', - depends_on: ['vary-3-match'], - requests: [ - vary3Setup({}), - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'], - ['Bar', 'abcde'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache reuses a three-way `Vary` response when both request and the original request omited a variant header', - id: 'vary-3-omit', - depends_on: ['vary-3-match'], - kind: 'optimal', - requests: [ - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Date', 0], - ['Last-Modified', -3000], - ['Vary', 'Foo, Bar, Baz', false] // FIXME: allow whitespace changes - ], - setup: true - }, - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'HTTP cache must not reuse `Vary` response with a value of `*`', - id: 'vary-star', - requests: [ - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', '*'] - ], - setup: true - }, - { - request_headers: [ - ['Foo', '1'], - ['Baz', '789'] - ], - expected_type: 'not_cached' - } - ] - }, - { - name: 'An optimal HTTP cache normalises unknown selecting headers by combining fields', - id: 'vary-normalise-combine', - depends_on: ['vary-match'], - kind: 'optimal', - requests: [ - { - request_headers: [ - ['Foo', '1, 2'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Foo'] - ], - setup: true - }, - { - request_headers: [ - ['Foo', '1'], - ['Foo', '2'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache normalises `Accept-Language` by ignoring language order', - id: 'vary-normalise-lang-order', - depends_on: ['vary-match'], - kind: 'optimal', - requests: [ - { - request_headers: [ - ['Accept-Language', 'en, de'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Accept-Language'] - ], - setup: true - }, - { - request_headers: [ - ['Accept-Language', 'de, en'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache normalises `Accept-Language` by ignoring language case', - id: 'vary-normalise-lang-case', - depends_on: ['vary-match'], - kind: 'optimal', - requests: [ - { - request_headers: [ - ['Accept-Language', 'en, de'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Accept-Language'] - ], - setup: true - }, - { - request_headers: [ - ['Accept-Language', 'eN, De'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache normalises `Accept-Language` by ignoring whitespace', - id: 'vary-normalise-lang-space', - depends_on: ['vary-match'], - kind: 'optimal', - requests: [ - { - request_headers: [ - ['Accept-Language', 'en, de'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Accept-Language'] - ], - setup: true - }, - { - request_headers: [ - ['Accept-Language', ' en , de'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache selects `Content-Language` by using the qvalue on `Accept-Language`', - id: 'vary-normalise-lang-select', - depends_on: ['vary-match'], - kind: 'optimal', - requests: [ - { - request_headers: [ - ['Accept-Language', 'en, de'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Accept-Language'], - ['Content-Language', 'de'] - ], - setup: true - }, - { - request_headers: [ - ['Accept-Language', 'fr;q=0.5, de;q=1.0'] - ], - expected_type: 'cached' - } - ] - }, - { - name: 'An optimal HTTP cache normalises unknown selecting headers by removing whitespace', - id: 'vary-normalise-space', - depends_on: ['vary-match'], - kind: 'optimal', - requests: [ - { - request_headers: [ - ['Foo', '1,2'] - ], - response_headers: [ - ['Cache-Control', 'max-age=5000'], - ['Last-Modified', -3000], - ['Date', 0], - ['Vary', 'Foo'] - ], - setup: true - }, - { - request_headers: [ - ['Foo', ' 1, 2 '] - ], - expected_type: 'cached' - } - ] - } - ] -}