@roberttlange/agentlens 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +26 -0
- package/dist/browser.js +216 -0
- package/dist/browser.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +394 -0
- package/dist/main.js.map +1 -0
- package/dist/main.test.d.ts +1 -0
- package/dist/main.test.js +403 -0
- package/dist/main.test.js.map +1 -0
- package/node_modules/@agentlens/contracts/dist/index.d.ts +221 -0
- package/node_modules/@agentlens/contracts/dist/index.js +2 -0
- package/node_modules/@agentlens/contracts/dist/index.js.map +1 -0
- package/node_modules/@agentlens/contracts/package.json +22 -0
- package/node_modules/@agentlens/core/dist/__tests__/activityStatus.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/activityStatus.test.js +485 -0
- package/node_modules/@agentlens/core/dist/__tests__/activityStatus.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/config.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/config.test.js +121 -0
- package/node_modules/@agentlens/core/dist/__tests__/config.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/index.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/__tests__/index.test.js +2058 -0
- package/node_modules/@agentlens/core/dist/__tests__/index.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/config.d.ts +9 -0
- package/node_modules/@agentlens/core/dist/config.js +273 -0
- package/node_modules/@agentlens/core/dist/config.js.map +1 -0
- package/node_modules/@agentlens/core/dist/discovery.d.ts +13 -0
- package/node_modules/@agentlens/core/dist/discovery.js +177 -0
- package/node_modules/@agentlens/core/dist/discovery.js.map +1 -0
- package/node_modules/@agentlens/core/dist/index.d.ts +6 -0
- package/node_modules/@agentlens/core/dist/index.js +7 -0
- package/node_modules/@agentlens/core/dist/index.js.map +1 -0
- package/node_modules/@agentlens/core/dist/metrics.d.ts +10 -0
- package/node_modules/@agentlens/core/dist/metrics.js +445 -0
- package/node_modules/@agentlens/core/dist/metrics.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.js +264 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.test.js +87 -0
- package/node_modules/@agentlens/core/dist/parsers/claude.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/codex.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/codex.js +526 -0
- package/node_modules/@agentlens/core/dist/parsers/codex.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/common.d.ts +35 -0
- package/node_modules/@agentlens/core/dist/parsers/common.js +138 -0
- package/node_modules/@agentlens/core/dist/parsers/common.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.js +511 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.test.js +179 -0
- package/node_modules/@agentlens/core/dist/parsers/cursor.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.d.ts +9 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.js +403 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.test.js +107 -0
- package/node_modules/@agentlens/core/dist/parsers/gemini.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/generic.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/generic.js +32 -0
- package/node_modules/@agentlens/core/dist/parsers/generic.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/index.d.ts +11 -0
- package/node_modules/@agentlens/core/dist/parsers/index.js +59 -0
- package/node_modules/@agentlens/core/dist/parsers/index.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.d.ts +8 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.js +591 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.test.d.ts +1 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.test.js +219 -0
- package/node_modules/@agentlens/core/dist/parsers/opencode.test.js.map +1 -0
- package/node_modules/@agentlens/core/dist/parsers/types.d.ts +15 -0
- package/node_modules/@agentlens/core/dist/parsers/types.js +2 -0
- package/node_modules/@agentlens/core/dist/parsers/types.js.map +1 -0
- package/node_modules/@agentlens/core/dist/redaction.d.ts +3 -0
- package/node_modules/@agentlens/core/dist/redaction.js +97 -0
- package/node_modules/@agentlens/core/dist/redaction.js.map +1 -0
- package/node_modules/@agentlens/core/dist/snapshot.d.ts +2 -0
- package/node_modules/@agentlens/core/dist/snapshot.js +9 -0
- package/node_modules/@agentlens/core/dist/snapshot.js.map +1 -0
- package/node_modules/@agentlens/core/dist/sourceProfiles.d.ts +4 -0
- package/node_modules/@agentlens/core/dist/sourceProfiles.js +176 -0
- package/node_modules/@agentlens/core/dist/sourceProfiles.js.map +1 -0
- package/node_modules/@agentlens/core/dist/traceIndex.d.ts +66 -0
- package/node_modules/@agentlens/core/dist/traceIndex.js +1281 -0
- package/node_modules/@agentlens/core/dist/traceIndex.js.map +1 -0
- package/node_modules/@agentlens/core/dist/utils.d.ts +10 -0
- package/node_modules/@agentlens/core/dist/utils.js +125 -0
- package/node_modules/@agentlens/core/dist/utils.js.map +1 -0
- package/node_modules/@agentlens/core/package.json +28 -0
- package/node_modules/@agentlens/server/dist/app.d.ts +133 -0
- package/node_modules/@agentlens/server/dist/app.js +1939 -0
- package/node_modules/@agentlens/server/dist/app.js.map +1 -0
- package/node_modules/@agentlens/server/dist/app.test.d.ts +1 -0
- package/node_modules/@agentlens/server/dist/app.test.js +925 -0
- package/node_modules/@agentlens/server/dist/app.test.js.map +1 -0
- package/node_modules/@agentlens/server/dist/main.d.ts +1 -0
- package/node_modules/@agentlens/server/dist/main.js +3 -0
- package/node_modules/@agentlens/server/dist/main.js.map +1 -0
- package/node_modules/@agentlens/server/dist/web/assets/index-B9pmgl04.js +52 -0
- package/node_modules/@agentlens/server/dist/web/assets/index-Dwy5TIZL.css +1 -0
- package/node_modules/@agentlens/server/dist/web/favicon.png +0 -0
- package/node_modules/@agentlens/server/dist/web/favicon.svg +37 -0
- package/node_modules/@agentlens/server/dist/web/icons/claude.svg +7 -0
- package/node_modules/@agentlens/server/dist/web/icons/cursor.jpeg +0 -0
- package/node_modules/@agentlens/server/dist/web/icons/cursor.svg +5 -0
- package/node_modules/@agentlens/server/dist/web/icons/gemini.jpeg +0 -0
- package/node_modules/@agentlens/server/dist/web/icons/gemini.svg +37 -0
- package/node_modules/@agentlens/server/dist/web/icons/openai.svg +2 -0
- package/node_modules/@agentlens/server/dist/web/icons/opencode.png +0 -0
- package/node_modules/@agentlens/server/dist/web/index.html +17 -0
- package/node_modules/@agentlens/server/package.json +24 -0
- package/node_modules/@fastify/accept-negotiator/LICENSE +22 -0
- package/node_modules/@fastify/accept-negotiator/README.md +52 -0
- package/node_modules/@fastify/accept-negotiator/index.js +170 -0
- package/node_modules/@fastify/accept-negotiator/package.json +77 -0
- package/node_modules/@fastify/accept-negotiator/types/index.d.ts +17 -0
- package/node_modules/@fastify/ajv-compiler/.gitattributes +2 -0
- package/node_modules/@fastify/ajv-compiler/.github/.stale.yml +21 -0
- package/node_modules/@fastify/ajv-compiler/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/ajv-compiler/.github/tests_checker.yml +8 -0
- package/node_modules/@fastify/ajv-compiler/.github/workflows/ci.yml +33 -0
- package/node_modules/@fastify/ajv-compiler/LICENSE +23 -0
- package/node_modules/@fastify/ajv-compiler/README.md +237 -0
- package/node_modules/@fastify/ajv-compiler/benchmark/small-object.mjs +37 -0
- package/node_modules/@fastify/ajv-compiler/eslint.config.js +6 -0
- package/node_modules/@fastify/ajv-compiler/index.js +53 -0
- package/node_modules/@fastify/ajv-compiler/lib/default-ajv-options.js +14 -0
- package/node_modules/@fastify/ajv-compiler/lib/serializer-compiler.js +27 -0
- package/node_modules/@fastify/ajv-compiler/lib/validator-compiler.js +58 -0
- package/node_modules/@fastify/ajv-compiler/package.json +84 -0
- package/node_modules/@fastify/ajv-compiler/standalone.js +44 -0
- package/node_modules/@fastify/ajv-compiler/test/.gitkeep +0 -0
- package/node_modules/@fastify/ajv-compiler/test/duplicated-id-compile.test.js +55 -0
- package/node_modules/@fastify/ajv-compiler/test/index.test.js +307 -0
- package/node_modules/@fastify/ajv-compiler/test/plugins.test.js +246 -0
- package/node_modules/@fastify/ajv-compiler/test/serialization.test.js +279 -0
- package/node_modules/@fastify/ajv-compiler/test/standalone.test.js +203 -0
- package/node_modules/@fastify/ajv-compiler/types/index.d.ts +87 -0
- package/node_modules/@fastify/ajv-compiler/types/index.test-d.ts +302 -0
- package/node_modules/@fastify/error/.gitattributes +2 -0
- package/node_modules/@fastify/error/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/error/.github/workflows/ci.yml +28 -0
- package/node_modules/@fastify/error/LICENSE +21 -0
- package/node_modules/@fastify/error/README.md +140 -0
- package/node_modules/@fastify/error/benchmarks/create.js +9 -0
- package/node_modules/@fastify/error/benchmarks/instantiate.js +18 -0
- package/node_modules/@fastify/error/benchmarks/no-stack.js +13 -0
- package/node_modules/@fastify/error/benchmarks/toString.js +11 -0
- package/node_modules/@fastify/error/eslint.config.js +6 -0
- package/node_modules/@fastify/error/index.js +100 -0
- package/node_modules/@fastify/error/package.json +75 -0
- package/node_modules/@fastify/error/test/index.test.js +232 -0
- package/node_modules/@fastify/error/test/instanceof.test.js +263 -0
- package/node_modules/@fastify/error/types/index.d.ts +49 -0
- package/node_modules/@fastify/error/types/index.test-d.ts +92 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/.eslintrc +1 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/.gitattributes +2 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/.github/workflows/ci.yml +28 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/LICENSE +21 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/README.md +128 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/eslint.config.js +6 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/index.js +8 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/package.json +71 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/standalone.js +58 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/test/duplicate-schema.test.js +26 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/test/plugin.test.js +78 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/test/standalone.test.js +230 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/types/index.d.ts +41 -0
- package/node_modules/@fastify/fast-json-stringify-compiler/types/index.test-d.ts +142 -0
- package/node_modules/@fastify/forwarded/LICENSE +24 -0
- package/node_modules/@fastify/forwarded/README.md +43 -0
- package/node_modules/@fastify/forwarded/index.js +59 -0
- package/node_modules/@fastify/forwarded/package.json +74 -0
- package/node_modules/@fastify/forwarded/types/index.d.ts +14 -0
- package/node_modules/@fastify/merge-json-schemas/.gitattributes +2 -0
- package/node_modules/@fastify/merge-json-schemas/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/merge-json-schemas/.github/workflows/ci.yml +23 -0
- package/node_modules/@fastify/merge-json-schemas/LICENSE +21 -0
- package/node_modules/@fastify/merge-json-schemas/README.md +119 -0
- package/node_modules/@fastify/merge-json-schemas/eslint.config.js +6 -0
- package/node_modules/@fastify/merge-json-schemas/index.js +357 -0
- package/node_modules/@fastify/merge-json-schemas/lib/errors.js +36 -0
- package/node_modules/@fastify/merge-json-schemas/lib/resolvers.js +127 -0
- package/node_modules/@fastify/merge-json-schemas/package.json +67 -0
- package/node_modules/@fastify/merge-json-schemas/test/additional-items.test.js +164 -0
- package/node_modules/@fastify/merge-json-schemas/test/additional-properties.test.js +129 -0
- package/node_modules/@fastify/merge-json-schemas/test/all-of.test.js +43 -0
- package/node_modules/@fastify/merge-json-schemas/test/any-of.test.js +81 -0
- package/node_modules/@fastify/merge-json-schemas/test/const.test.js +58 -0
- package/node_modules/@fastify/merge-json-schemas/test/contains.test.js +55 -0
- package/node_modules/@fastify/merge-json-schemas/test/custom-resolvers.test.js +50 -0
- package/node_modules/@fastify/merge-json-schemas/test/default-resolver.test.js +111 -0
- package/node_modules/@fastify/merge-json-schemas/test/default.test.js +50 -0
- package/node_modules/@fastify/merge-json-schemas/test/definitions.test.js +46 -0
- package/node_modules/@fastify/merge-json-schemas/test/defs.test.js +46 -0
- package/node_modules/@fastify/merge-json-schemas/test/dependencies.test.js +75 -0
- package/node_modules/@fastify/merge-json-schemas/test/dependent-required.test.js +75 -0
- package/node_modules/@fastify/merge-json-schemas/test/dependent-schemas.test.js +76 -0
- package/node_modules/@fastify/merge-json-schemas/test/enum.test.js +44 -0
- package/node_modules/@fastify/merge-json-schemas/test/exclusive-maximum.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/exclusive-minimum.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/format.test.js +36 -0
- package/node_modules/@fastify/merge-json-schemas/test/id.test.js +22 -0
- package/node_modules/@fastify/merge-json-schemas/test/if-then-else.test.js +550 -0
- package/node_modules/@fastify/merge-json-schemas/test/items.test.js +152 -0
- package/node_modules/@fastify/merge-json-schemas/test/max-items.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/max-length.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/max-properties.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/maximum.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/merge-schema.test.js +29 -0
- package/node_modules/@fastify/merge-json-schemas/test/min-items.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/min-length.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/min-properties.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/minimum.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/multiple-of.test.js +36 -0
- package/node_modules/@fastify/merge-json-schemas/test/not.test.js +29 -0
- package/node_modules/@fastify/merge-json-schemas/test/nullable.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/one-of.test.js +144 -0
- package/node_modules/@fastify/merge-json-schemas/test/properties.test.js +312 -0
- package/node_modules/@fastify/merge-json-schemas/test/property-names.test.js +49 -0
- package/node_modules/@fastify/merge-json-schemas/test/required.test.js +30 -0
- package/node_modules/@fastify/merge-json-schemas/test/type.test.js +52 -0
- package/node_modules/@fastify/merge-json-schemas/test/unique-items.test.js +38 -0
- package/node_modules/@fastify/merge-json-schemas/test/utils.js +9 -0
- package/node_modules/@fastify/merge-json-schemas/types/index.d.ts +61 -0
- package/node_modules/@fastify/merge-json-schemas/types/index.test-d.ts +52 -0
- package/node_modules/@fastify/proxy-addr/.gitattributes +2 -0
- package/node_modules/@fastify/proxy-addr/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/proxy-addr/.github/stale.yml +21 -0
- package/node_modules/@fastify/proxy-addr/.github/workflows/ci.yml +28 -0
- package/node_modules/@fastify/proxy-addr/LICENSE +24 -0
- package/node_modules/@fastify/proxy-addr/README.md +141 -0
- package/node_modules/@fastify/proxy-addr/benchmark/compiling.js +50 -0
- package/node_modules/@fastify/proxy-addr/benchmark/index.js +30 -0
- package/node_modules/@fastify/proxy-addr/benchmark/kind.js +57 -0
- package/node_modules/@fastify/proxy-addr/benchmark/matching.js +78 -0
- package/node_modules/@fastify/proxy-addr/eslint.config.js +6 -0
- package/node_modules/@fastify/proxy-addr/index.js +331 -0
- package/node_modules/@fastify/proxy-addr/package.json +73 -0
- package/node_modules/@fastify/proxy-addr/test/all.test.js +55 -0
- package/node_modules/@fastify/proxy-addr/test/base.test.js +365 -0
- package/node_modules/@fastify/proxy-addr/test/compile.test.js +58 -0
- package/node_modules/@fastify/proxy-addr/types/index.d.ts +18 -0
- package/node_modules/@fastify/proxy-addr/types/index.test-d.ts +27 -0
- package/node_modules/@fastify/send/.gitattributes +2 -0
- package/node_modules/@fastify/send/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/send/.github/workflows/ci.yml +28 -0
- package/node_modules/@fastify/send/HISTORY.md +521 -0
- package/node_modules/@fastify/send/LICENSE +23 -0
- package/node_modules/@fastify/send/README.md +310 -0
- package/node_modules/@fastify/send/benchmarks/collapseLeadingSlashes.js +13 -0
- package/node_modules/@fastify/send/benchmarks/containsDotFile.js +15 -0
- package/node_modules/@fastify/send/benchmarks/isUtf8MimeType.js +23 -0
- package/node_modules/@fastify/send/benchmarks/normalizeList.js +14 -0
- package/node_modules/@fastify/send/benchmarks/parseBytesRange.js +15 -0
- package/node_modules/@fastify/send/eslint.config.js +6 -0
- package/node_modules/@fastify/send/examples/index.html +1 -0
- package/node_modules/@fastify/send/examples/simple.js +15 -0
- package/node_modules/@fastify/send/index.js +28 -0
- package/node_modules/@fastify/send/lib/collapseLeadingSlashes.js +25 -0
- package/node_modules/@fastify/send/lib/containsDotFile.js +23 -0
- package/node_modules/@fastify/send/lib/contentRange.js +18 -0
- package/node_modules/@fastify/send/lib/createHtmlDocument.js +29 -0
- package/node_modules/@fastify/send/lib/createHttpError.js +23 -0
- package/node_modules/@fastify/send/lib/isUtf8MimeType.js +12 -0
- package/node_modules/@fastify/send/lib/normalizeList.js +28 -0
- package/node_modules/@fastify/send/lib/parseBytesRange.js +133 -0
- package/node_modules/@fastify/send/lib/parseTokenList.js +46 -0
- package/node_modules/@fastify/send/lib/send.js +729 -0
- package/node_modules/@fastify/send/package.json +81 -0
- package/node_modules/@fastify/send/test/collapseLeadingSlashes.test.js +22 -0
- package/node_modules/@fastify/send/test/containsDotFile.test.js +18 -0
- package/node_modules/@fastify/send/test/fixtures/.hidden.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/.mine/.hidden.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/.mine/name.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/do..ts.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/empty.txt +0 -0
- package/node_modules/@fastify/send/test/fixtures/images/node-js.png +0 -0
- package/node_modules/@fastify/send/test/fixtures/name.d/name.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/name.dir/name.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/name.html +1 -0
- package/node_modules/@fastify/send/test/fixtures/name.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/no_ext +1 -0
- package/node_modules/@fastify/send/test/fixtures/nums.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/pets/.hidden.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/pets/index.html +3 -0
- package/node_modules/@fastify/send/test/fixtures/snow /342/230/203/index.html +0 -0
- package/node_modules/@fastify/send/test/fixtures/some thing.txt +1 -0
- package/node_modules/@fastify/send/test/fixtures/thing.html.html +1 -0
- package/node_modules/@fastify/send/test/fixtures/tobi.html +1 -0
- package/node_modules/@fastify/send/test/isUtf8MimeType.test.js +22 -0
- package/node_modules/@fastify/send/test/mime.test.js +56 -0
- package/node_modules/@fastify/send/test/normalizeList.test.js +28 -0
- package/node_modules/@fastify/send/test/parseBytesRange.test.js +103 -0
- package/node_modules/@fastify/send/test/send.1.test.js +646 -0
- package/node_modules/@fastify/send/test/send.2.test.js +977 -0
- package/node_modules/@fastify/send/test/send.3.test.js +133 -0
- package/node_modules/@fastify/send/test/utils.js +36 -0
- package/node_modules/@fastify/send/types/index.d.ts +167 -0
- package/node_modules/@fastify/send/types/index.test-d.ts +67 -0
- package/node_modules/@fastify/static/.gitattributes +5 -0
- package/node_modules/@fastify/static/.github/dependabot.yml +13 -0
- package/node_modules/@fastify/static/.github/stale.yml +21 -0
- package/node_modules/@fastify/static/.github/workflows/ci.yml +33 -0
- package/node_modules/@fastify/static/LICENSE +23 -0
- package/node_modules/@fastify/static/README.md +538 -0
- package/node_modules/@fastify/static/eslint.config.js +7 -0
- package/node_modules/@fastify/static/example/public/.hidden/sample.json +1 -0
- package/node_modules/@fastify/static/example/public/images/sample.jpg +0 -0
- package/node_modules/@fastify/static/example/public/index.css +9 -0
- package/node_modules/@fastify/static/example/public/index.html +11 -0
- package/node_modules/@fastify/static/example/public/index.js +8 -0
- package/node_modules/@fastify/static/example/public2/test.css +4 -0
- package/node_modules/@fastify/static/example/public2/test.html +8 -0
- package/node_modules/@fastify/static/example/server-compress.js +15 -0
- package/node_modules/@fastify/static/example/server-dir-list.js +38 -0
- package/node_modules/@fastify/static/example/server-hidden-file.js +15 -0
- package/node_modules/@fastify/static/example/server.js +13 -0
- package/node_modules/@fastify/static/index.js +580 -0
- package/node_modules/@fastify/static/lib/dirList.js +211 -0
- package/node_modules/@fastify/static/package.json +87 -0
- package/node_modules/@fastify/static/test/content-type/binary +0 -0
- package/node_modules/@fastify/static/test/content-type/binary.br +1 -0
- package/node_modules/@fastify/static/test/content-type/index.css +0 -0
- package/node_modules/@fastify/static/test/content-type/index.css.br +1 -0
- package/node_modules/@fastify/static/test/content-type/index.html +5 -0
- package/node_modules/@fastify/static/test/content-type/index.html.br +0 -0
- package/node_modules/@fastify/static/test/content-type/sample.jpg +0 -0
- package/node_modules/@fastify/static/test/content-type/test.txt +0 -0
- package/node_modules/@fastify/static/test/content-type/test.txt.br +1 -0
- package/node_modules/@fastify/static/test/content-type.test.js +144 -0
- package/node_modules/@fastify/static/test/dir-list.test.js +738 -0
- package/node_modules/@fastify/static/test/static/.example +1 -0
- package/node_modules/@fastify/static/test/static/100%.txt +1 -0
- package/node_modules/@fastify/static/test/static/a .md +1 -0
- package/node_modules/@fastify/static/test/static/deep/path/for/test/index.html +5 -0
- package/node_modules/@fastify/static/test/static/deep/path/for/test/purpose/foo.html +5 -0
- package/node_modules/@fastify/static/test/static/foo.html +3 -0
- package/node_modules/@fastify/static/test/static/foobar.html +3 -0
- package/node_modules/@fastify/static/test/static/index.css +0 -0
- package/node_modules/@fastify/static/test/static/index.html +5 -0
- package/node_modules/@fastify/static/test/static/shallow/sample.jpg +0 -0
- package/node_modules/@fastify/static/test/static-dotfiles/.aaa +0 -0
- package/node_modules/@fastify/static/test/static-dotfiles/dir/index.html +0 -0
- package/node_modules/@fastify/static/test/static-dotfiles/test.txt +0 -0
- package/node_modules/@fastify/static/test/static-encode/[...]/a .md +1 -0
- package/node_modules/@fastify/static/test/static-filtered/bar.private +1 -0
- package/node_modules/@fastify/static/test/static-filtered/deep/path/to/baz.html +3 -0
- package/node_modules/@fastify/static/test/static-filtered/deep/path/to/baz.private +1 -0
- package/node_modules/@fastify/static/test/static-filtered/index.html +3 -0
- package/node_modules/@fastify/static/test/static-hidden/.hidden/sample.json +1 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/all-three.html +5 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/all-three.html.br +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/all-three.html.gz +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/baz.json +3 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/dir/index.html +5 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/dir/index.html.br +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/dir-gz/index.html +5 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/dir-gz/index.html.gz +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/empty/.gitkeep +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/gzip-only.html +3 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/gzip-only.html.gz +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/index.html +5 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/index.html.br +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/sample.jpg +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/sample.jpg.br +0 -0
- package/node_modules/@fastify/static/test/static-pre-compressed/uncompressed.html +3 -0
- package/node_modules/@fastify/static/test/static-symbolic-link/origin/subdir/subdir/index.html +3 -0
- package/node_modules/@fastify/static/test/static.test.js +3793 -0
- package/node_modules/@fastify/static/test/static2/bar.html +3 -0
- package/node_modules/@fastify/static/test/static2/index.html +3 -0
- package/node_modules/@fastify/static/types/index.d.ts +140 -0
- package/node_modules/@fastify/static/types/index.test-d.ts +240 -0
- package/node_modules/@iarna/toml/LICENSE +14 -0
- package/node_modules/@iarna/toml/README.md +301 -0
- package/node_modules/@iarna/toml/index.d.ts +57 -0
- package/node_modules/@iarna/toml/lib/create-date.js +23 -0
- package/node_modules/@iarna/toml/lib/create-datetime-float.js +24 -0
- package/node_modules/@iarna/toml/lib/create-datetime.js +10 -0
- package/node_modules/@iarna/toml/lib/create-time.js +22 -0
- package/node_modules/@iarna/toml/lib/format-num.js +6 -0
- package/node_modules/@iarna/toml/lib/parser-debug.js +60 -0
- package/node_modules/@iarna/toml/lib/parser.js +127 -0
- package/node_modules/@iarna/toml/lib/toml-parser.js +1379 -0
- package/node_modules/@iarna/toml/package.json +82 -0
- package/node_modules/@iarna/toml/parse-async.js +30 -0
- package/node_modules/@iarna/toml/parse-pretty-error.js +33 -0
- package/node_modules/@iarna/toml/parse-stream.js +80 -0
- package/node_modules/@iarna/toml/parse-string.js +18 -0
- package/node_modules/@iarna/toml/parse.js +5 -0
- package/node_modules/@iarna/toml/stringify.js +296 -0
- package/node_modules/@iarna/toml/toml.js +3 -0
- package/node_modules/@isaacs/balanced-match/LICENSE.md +23 -0
- package/node_modules/@isaacs/balanced-match/README.md +60 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts +9 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.js +59 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts +9 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.js +54 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/balanced-match/package.json +79 -0
- package/node_modules/@isaacs/brace-expansion/LICENSE +23 -0
- package/node_modules/@isaacs/brace-expansion/README.md +97 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts +6 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +199 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts +6 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.js +195 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/brace-expansion/package.json +60 -0
- package/node_modules/@isaacs/cliui/LICENSE.md +63 -0
- package/node_modules/@isaacs/cliui/README.md +151 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts +4 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js +16 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts +34 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js +170 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts +6 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js +307 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts +2 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js +7 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts +41 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.js +322 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.min.js +12 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts +5 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js +49 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts +2 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js +8 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts +7 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js +176 -0
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts +4 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js +12 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts +34 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js +167 -0
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts +6 -0
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js +299 -0
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts +2 -0
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js +3 -0
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.d.ts +41 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.js +317 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.min.js +12 -0
- package/node_modules/@isaacs/cliui/dist/esm/index.min.js.map +7 -0
- package/node_modules/@isaacs/cliui/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts +5 -0
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.js +46 -0
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts +2 -0
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js +4 -0
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts +7 -0
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts.map +1 -0
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js +172 -0
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js.map +1 -0
- package/node_modules/@isaacs/cliui/package.json +163 -0
- package/node_modules/@lukeed/ms/dist/index.js +37 -0
- package/node_modules/@lukeed/ms/dist/index.min.js +1 -0
- package/node_modules/@lukeed/ms/dist/index.mjs +34 -0
- package/node_modules/@lukeed/ms/index.d.ts +2 -0
- package/node_modules/@lukeed/ms/license +9 -0
- package/node_modules/@lukeed/ms/package.json +48 -0
- package/node_modules/@lukeed/ms/readme.md +133 -0
- package/node_modules/@nodelib/fs.scandir/LICENSE +21 -0
- package/node_modules/@nodelib/fs.scandir/README.md +171 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
- package/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
- package/node_modules/@nodelib/fs.scandir/package.json +44 -0
- package/node_modules/@nodelib/fs.stat/LICENSE +21 -0
- package/node_modules/@nodelib/fs.stat/README.md +126 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
- package/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.stat/out/index.js +26 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
- package/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.stat/package.json +37 -0
- package/node_modules/@nodelib/fs.walk/LICENSE +21 -0
- package/node_modules/@nodelib/fs.walk/README.md +215 -0
- package/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/node_modules/@nodelib/fs.walk/out/index.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
- package/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.walk/package.json +44 -0
- package/node_modules/@pinojs/redact/.github/dependabot.yml +13 -0
- package/node_modules/@pinojs/redact/.github/workflows/ci.yml +48 -0
- package/node_modules/@pinojs/redact/.github/workflows/publish-release.yml +43 -0
- package/node_modules/@pinojs/redact/LICENSE +21 -0
- package/node_modules/@pinojs/redact/README.md +350 -0
- package/node_modules/@pinojs/redact/benchmarks/basic.js +184 -0
- package/node_modules/@pinojs/redact/eslint.config.js +1 -0
- package/node_modules/@pinojs/redact/index.d.ts +52 -0
- package/node_modules/@pinojs/redact/index.js +529 -0
- package/node_modules/@pinojs/redact/index.test-d.ts +22 -0
- package/node_modules/@pinojs/redact/package.json +37 -0
- package/node_modules/@pinojs/redact/scripts/sync-version.mjs +20 -0
- package/node_modules/@pinojs/redact/test/actual-redact-comparison.test.js +211 -0
- package/node_modules/@pinojs/redact/test/index.test.js +824 -0
- package/node_modules/@pinojs/redact/test/integration.test.js +390 -0
- package/node_modules/@pinojs/redact/test/multiple-wildcards.test.js +227 -0
- package/node_modules/@pinojs/redact/test/prototype-pollution.test.js +223 -0
- package/node_modules/@pinojs/redact/test/selective-clone.test.js +115 -0
- package/node_modules/@pinojs/redact/tsconfig.json +19 -0
- package/node_modules/abstract-logging/Readme.md +47 -0
- package/node_modules/abstract-logging/index.js +18 -0
- package/node_modules/abstract-logging/package.json +25 -0
- package/node_modules/abstract-logging/test.js +17 -0
- package/node_modules/ajv/.runkit_example.js +23 -0
- package/node_modules/ajv/LICENSE +22 -0
- package/node_modules/ajv/README.md +207 -0
- package/node_modules/ajv/dist/2019.d.ts +19 -0
- package/node_modules/ajv/dist/2019.js +61 -0
- package/node_modules/ajv/dist/2019.js.map +1 -0
- package/node_modules/ajv/dist/2020.d.ts +19 -0
- package/node_modules/ajv/dist/2020.js +55 -0
- package/node_modules/ajv/dist/2020.js.map +1 -0
- package/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/node_modules/ajv/dist/ajv.js +50 -0
- package/node_modules/ajv/dist/ajv.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/node_modules/ajv/dist/compile/errors.js +123 -0
- package/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/node_modules/ajv/dist/compile/index.js +242 -0
- package/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js +229 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/node_modules/ajv/dist/compile/names.js +28 -0
- package/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/node_modules/ajv/dist/compile/rules.js +26 -0
- package/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/node_modules/ajv/dist/compile/util.js +178 -0
- package/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/node_modules/ajv/dist/core.d.ts +173 -0
- package/node_modules/ajv/dist/core.js +618 -0
- package/node_modules/ajv/dist/core.js.map +1 -0
- package/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/node_modules/ajv/dist/jtd.js +72 -0
- package/node_modules/ajv/dist/jtd.js.map +1 -0
- package/node_modules/ajv/dist/refs/data.json +13 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/node_modules/ajv/dist/standalone/index.js +90 -0
- package/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/node_modules/ajv/dist/types/index.js +3 -0
- package/node_modules/ajv/dist/types/index.js.map +1 -0
- package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/node_modules/ajv/lib/2019.ts +81 -0
- package/node_modules/ajv/lib/2020.ts +75 -0
- package/node_modules/ajv/lib/ajv.ts +70 -0
- package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/node_modules/ajv/lib/compile/index.ts +324 -0
- package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/node_modules/ajv/lib/compile/jtd/serialize.ts +266 -0
- package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/node_modules/ajv/lib/compile/names.ts +27 -0
- package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/node_modules/ajv/lib/compile/util.ts +213 -0
- package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/node_modules/ajv/lib/core.ts +891 -0
- package/node_modules/ajv/lib/jtd.ts +132 -0
- package/node_modules/ajv/lib/refs/data.json +13 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/node_modules/ajv/lib/types/index.ts +244 -0
- package/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/node_modules/ajv/package.json +126 -0
- package/node_modules/ajv-formats/LICENSE +21 -0
- package/node_modules/ajv-formats/README.md +125 -0
- package/node_modules/ajv-formats/dist/formats.d.ts +9 -0
- package/node_modules/ajv-formats/dist/formats.js +208 -0
- package/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/node_modules/ajv-formats/dist/index.d.ts +15 -0
- package/node_modules/ajv-formats/dist/index.js +37 -0
- package/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/node_modules/ajv-formats/dist/limit.d.ts +10 -0
- package/node_modules/ajv-formats/dist/limit.js +69 -0
- package/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/node_modules/ajv-formats/package.json +74 -0
- package/node_modules/ajv-formats/src/formats.ts +269 -0
- package/node_modules/ajv-formats/src/index.ts +62 -0
- package/node_modules/ajv-formats/src/limit.ts +99 -0
- package/node_modules/atomic-sleep/.travis.yml +11 -0
- package/node_modules/atomic-sleep/LICENSE +22 -0
- package/node_modules/atomic-sleep/index.js +38 -0
- package/node_modules/atomic-sleep/package.json +37 -0
- package/node_modules/atomic-sleep/readme.md +58 -0
- package/node_modules/atomic-sleep/test.js +47 -0
- package/node_modules/avvio/.gitattributes +2 -0
- package/node_modules/avvio/.github/dependabot.yml +13 -0
- package/node_modules/avvio/.github/release-drafter.yml +4 -0
- package/node_modules/avvio/.github/tests_checker.yml +3 -0
- package/node_modules/avvio/.github/workflows/ci.yml +24 -0
- package/node_modules/avvio/.taprc +3 -0
- package/node_modules/avvio/LICENSE +24 -0
- package/node_modules/avvio/README.md +670 -0
- package/node_modules/avvio/boot.js +607 -0
- package/node_modules/avvio/examples/example.js +72 -0
- package/node_modules/avvio/index.d.ts +92 -0
- package/node_modules/avvio/lib/create-promise.js +45 -0
- package/node_modules/avvio/lib/debug.js +19 -0
- package/node_modules/avvio/lib/errors.js +38 -0
- package/node_modules/avvio/lib/execute-with-thenable.js +28 -0
- package/node_modules/avvio/lib/get-plugin-name.js +34 -0
- package/node_modules/avvio/lib/is-bundled-or-typescript-plugin.js +23 -0
- package/node_modules/avvio/lib/is-promise-like.js +17 -0
- package/node_modules/avvio/lib/plugin.js +279 -0
- package/node_modules/avvio/lib/symbols.js +26 -0
- package/node_modules/avvio/lib/thenify.js +60 -0
- package/node_modules/avvio/lib/time-tree.js +200 -0
- package/node_modules/avvio/lib/validate-plugin.js +26 -0
- package/node_modules/avvio/package.json +51 -0
- package/node_modules/avvio/test/after-and-ready.test.js +864 -0
- package/node_modules/avvio/test/after-pass-through.test.js +32 -0
- package/node_modules/avvio/test/after-self-promise.test.js +20 -0
- package/node_modules/avvio/test/after-throw.test.js +24 -0
- package/node_modules/avvio/test/after-use-after.test.js +90 -0
- package/node_modules/avvio/test/async-await.test.js +325 -0
- package/node_modules/avvio/test/await-after.test.js +449 -0
- package/node_modules/avvio/test/await-self.test.js +31 -0
- package/node_modules/avvio/test/await-use.test.js +294 -0
- package/node_modules/avvio/test/basic.test.js +439 -0
- package/node_modules/avvio/test/callbacks.test.js +113 -0
- package/node_modules/avvio/test/catch-override-exception.test.js +26 -0
- package/node_modules/avvio/test/chainable.test.js +67 -0
- package/node_modules/avvio/test/close.test.js +544 -0
- package/node_modules/avvio/test/errors.test.js +26 -0
- package/node_modules/avvio/test/esm.mjs +12 -0
- package/node_modules/avvio/test/esm.test.js +14 -0
- package/node_modules/avvio/test/events-listeners.test.js +23 -0
- package/node_modules/avvio/test/expose.test.js +80 -0
- package/node_modules/avvio/test/fixtures/dummy.txt +1 -0
- package/node_modules/avvio/test/fixtures/esm.mjs +3 -0
- package/node_modules/avvio/test/fixtures/plugin-no-next.js +5 -0
- package/node_modules/avvio/test/gh-issues/bug-205.test.js +16 -0
- package/node_modules/avvio/test/lib/create-promise.test.js +55 -0
- package/node_modules/avvio/test/lib/execute-with-thenable.test.js +82 -0
- package/node_modules/avvio/test/lib/get-plugin-name.test.js +67 -0
- package/node_modules/avvio/test/lib/is-bundled-or-typescript-plugin.test.js +20 -0
- package/node_modules/avvio/test/lib/is-promise-like.test.js +20 -0
- package/node_modules/avvio/test/lib/thenify.test.js +123 -0
- package/node_modules/avvio/test/lib/time-tree.test.js +391 -0
- package/node_modules/avvio/test/lib/validate-plugin.test.js +19 -0
- package/node_modules/avvio/test/load-plugin.test.js +123 -0
- package/node_modules/avvio/test/no-done.test.js +18 -0
- package/node_modules/avvio/test/on-ready-timeout-await.test.js +33 -0
- package/node_modules/avvio/test/override.test.js +374 -0
- package/node_modules/avvio/test/plugin-loaded-so-far.test.js +84 -0
- package/node_modules/avvio/test/plugin-name.test.js +69 -0
- package/node_modules/avvio/test/plugin-timeout-await.test.js +33 -0
- package/node_modules/avvio/test/plugin-timeout.test.js +218 -0
- package/node_modules/avvio/test/pretty-print.test.js +75 -0
- package/node_modules/avvio/test/reentrant.test.js +124 -0
- package/node_modules/avvio/test/to-json.test.js +151 -0
- package/node_modules/avvio/test/twice-done.test.js +22 -0
- package/node_modules/avvio/test/types/index.ts +411 -0
- package/node_modules/avvio/test/types/tsconfig.json +9 -0
- package/node_modules/braces/LICENSE +21 -0
- package/node_modules/braces/README.md +586 -0
- package/node_modules/braces/index.js +170 -0
- package/node_modules/braces/lib/compile.js +60 -0
- package/node_modules/braces/lib/constants.js +57 -0
- package/node_modules/braces/lib/expand.js +113 -0
- package/node_modules/braces/lib/parse.js +331 -0
- package/node_modules/braces/lib/stringify.js +32 -0
- package/node_modules/braces/lib/utils.js +122 -0
- package/node_modules/braces/package.json +77 -0
- package/node_modules/chokidar/LICENSE +21 -0
- package/node_modules/chokidar/README.md +305 -0
- package/node_modules/chokidar/handler.d.ts +90 -0
- package/node_modules/chokidar/handler.js +632 -0
- package/node_modules/chokidar/index.d.ts +217 -0
- package/node_modules/chokidar/index.js +822 -0
- package/node_modules/chokidar/package.json +63 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1149 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2662 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +709 -0
- package/node_modules/commander/lib/option.js +367 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +82 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +1045 -0
- package/node_modules/content-disposition/HISTORY.md +60 -0
- package/node_modules/content-disposition/LICENSE +22 -0
- package/node_modules/content-disposition/README.md +142 -0
- package/node_modules/content-disposition/index.js +458 -0
- package/node_modules/content-disposition/package.json +44 -0
- package/node_modules/cookie/LICENSE +24 -0
- package/node_modules/cookie/README.md +295 -0
- package/node_modules/cookie/dist/index.d.ts +148 -0
- package/node_modules/cookie/dist/index.js +350 -0
- package/node_modules/cookie/dist/index.js.map +1 -0
- package/node_modules/cookie/package.json +47 -0
- package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/cross-spawn/README.md +89 -0
- package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/cross-spawn/lib/parse.js +91 -0
- package/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/node_modules/cross-spawn/package.json +73 -0
- package/node_modules/depd/History.md +103 -0
- package/node_modules/depd/LICENSE +22 -0
- package/node_modules/depd/Readme.md +280 -0
- package/node_modules/depd/index.js +538 -0
- package/node_modules/depd/lib/browser/index.js +77 -0
- package/node_modules/depd/package.json +45 -0
- package/node_modules/dequal/dist/index.js +86 -0
- package/node_modules/dequal/dist/index.min.js +1 -0
- package/node_modules/dequal/dist/index.mjs +84 -0
- package/node_modules/dequal/index.d.ts +1 -0
- package/node_modules/dequal/license +21 -0
- package/node_modules/dequal/lite/index.d.ts +1 -0
- package/node_modules/dequal/lite/index.js +31 -0
- package/node_modules/dequal/lite/index.min.js +1 -0
- package/node_modules/dequal/lite/index.mjs +29 -0
- package/node_modules/dequal/package.json +57 -0
- package/node_modules/dequal/readme.md +112 -0
- package/node_modules/escape-html/LICENSE +24 -0
- package/node_modules/escape-html/Readme.md +43 -0
- package/node_modules/escape-html/index.js +78 -0
- package/node_modules/escape-html/package.json +24 -0
- package/node_modules/fast-decode-uri-component/.travis.yml +12 -0
- package/node_modules/fast-decode-uri-component/LICENSE +23 -0
- package/node_modules/fast-decode-uri-component/README.md +43 -0
- package/node_modules/fast-decode-uri-component/bench.js +35 -0
- package/node_modules/fast-decode-uri-component/index.js +115 -0
- package/node_modules/fast-decode-uri-component/package.json +33 -0
- package/node_modules/fast-decode-uri-component/test.js +32 -0
- package/node_modules/fast-deep-equal/LICENSE +21 -0
- package/node_modules/fast-deep-equal/README.md +96 -0
- package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/react.js +79 -0
- package/node_modules/fast-deep-equal/index.d.ts +4 -0
- package/node_modules/fast-deep-equal/index.js +46 -0
- package/node_modules/fast-deep-equal/package.json +61 -0
- package/node_modules/fast-deep-equal/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/react.js +53 -0
- package/node_modules/fast-glob/LICENSE +21 -0
- package/node_modules/fast-glob/README.md +830 -0
- package/node_modules/fast-glob/out/index.d.ts +40 -0
- package/node_modules/fast-glob/out/index.js +102 -0
- package/node_modules/fast-glob/out/managers/tasks.d.ts +22 -0
- package/node_modules/fast-glob/out/managers/tasks.js +110 -0
- package/node_modules/fast-glob/out/providers/async.d.ts +9 -0
- package/node_modules/fast-glob/out/providers/async.js +23 -0
- package/node_modules/fast-glob/out/providers/filters/deep.d.ts +16 -0
- package/node_modules/fast-glob/out/providers/filters/deep.js +62 -0
- package/node_modules/fast-glob/out/providers/filters/entry.d.ts +17 -0
- package/node_modules/fast-glob/out/providers/filters/entry.js +85 -0
- package/node_modules/fast-glob/out/providers/filters/error.d.ts +8 -0
- package/node_modules/fast-glob/out/providers/filters/error.js +15 -0
- package/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +33 -0
- package/node_modules/fast-glob/out/providers/matchers/matcher.js +45 -0
- package/node_modules/fast-glob/out/providers/matchers/partial.d.ts +4 -0
- package/node_modules/fast-glob/out/providers/matchers/partial.js +38 -0
- package/node_modules/fast-glob/out/providers/provider.d.ts +19 -0
- package/node_modules/fast-glob/out/providers/provider.js +48 -0
- package/node_modules/fast-glob/out/providers/stream.d.ts +11 -0
- package/node_modules/fast-glob/out/providers/stream.js +31 -0
- package/node_modules/fast-glob/out/providers/sync.d.ts +9 -0
- package/node_modules/fast-glob/out/providers/sync.js +23 -0
- package/node_modules/fast-glob/out/providers/transformers/entry.d.ts +8 -0
- package/node_modules/fast-glob/out/providers/transformers/entry.js +26 -0
- package/node_modules/fast-glob/out/readers/async.d.ts +10 -0
- package/node_modules/fast-glob/out/readers/async.js +35 -0
- package/node_modules/fast-glob/out/readers/reader.d.ts +15 -0
- package/node_modules/fast-glob/out/readers/reader.js +33 -0
- package/node_modules/fast-glob/out/readers/stream.d.ts +14 -0
- package/node_modules/fast-glob/out/readers/stream.js +55 -0
- package/node_modules/fast-glob/out/readers/sync.d.ts +12 -0
- package/node_modules/fast-glob/out/readers/sync.js +43 -0
- package/node_modules/fast-glob/out/settings.d.ts +164 -0
- package/node_modules/fast-glob/out/settings.js +59 -0
- package/node_modules/fast-glob/out/types/index.d.ts +31 -0
- package/node_modules/fast-glob/out/types/index.js +2 -0
- package/node_modules/fast-glob/out/utils/array.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/array.js +22 -0
- package/node_modules/fast-glob/out/utils/errno.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/errno.js +7 -0
- package/node_modules/fast-glob/out/utils/fs.d.ts +4 -0
- package/node_modules/fast-glob/out/utils/fs.js +19 -0
- package/node_modules/fast-glob/out/utils/index.d.ts +8 -0
- package/node_modules/fast-glob/out/utils/index.js +17 -0
- package/node_modules/fast-glob/out/utils/path.d.ts +13 -0
- package/node_modules/fast-glob/out/utils/path.js +68 -0
- package/node_modules/fast-glob/out/utils/pattern.d.ts +49 -0
- package/node_modules/fast-glob/out/utils/pattern.js +206 -0
- package/node_modules/fast-glob/out/utils/stream.d.ts +4 -0
- package/node_modules/fast-glob/out/utils/stream.js +17 -0
- package/node_modules/fast-glob/out/utils/string.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/string.js +11 -0
- package/node_modules/fast-glob/package.json +81 -0
- package/node_modules/fast-json-stringify/.gitattributes +2 -0
- package/node_modules/fast-json-stringify/.github/dependabot.yml +13 -0
- package/node_modules/fast-json-stringify/.github/stale.yml +21 -0
- package/node_modules/fast-json-stringify/.github/workflows/ci.yml +33 -0
- package/node_modules/fast-json-stringify/LICENSE +24 -0
- package/node_modules/fast-json-stringify/README.md +742 -0
- package/node_modules/fast-json-stringify/benchmark/bench-cmp-branch.js +116 -0
- package/node_modules/fast-json-stringify/benchmark/bench-cmp-lib.js +323 -0
- package/node_modules/fast-json-stringify/benchmark/bench-thread.js +33 -0
- package/node_modules/fast-json-stringify/benchmark/bench.js +391 -0
- package/node_modules/fast-json-stringify/build/build-schema-validator.js +26 -0
- package/node_modules/fast-json-stringify/eslint.config.js +9 -0
- package/node_modules/fast-json-stringify/examples/example.js +81 -0
- package/node_modules/fast-json-stringify/examples/server.js +42 -0
- package/node_modules/fast-json-stringify/index.js +1312 -0
- package/node_modules/fast-json-stringify/lib/location.js +24 -0
- package/node_modules/fast-json-stringify/lib/merge-schemas.js +9 -0
- package/node_modules/fast-json-stringify/lib/schema-validator.js +1134 -0
- package/node_modules/fast-json-stringify/lib/serializer.js +141 -0
- package/node_modules/fast-json-stringify/lib/standalone.js +34 -0
- package/node_modules/fast-json-stringify/lib/validator.js +96 -0
- package/node_modules/fast-json-stringify/package.json +89 -0
- package/node_modules/fast-json-stringify/test/additionalProperties.test.js +332 -0
- package/node_modules/fast-json-stringify/test/allof.test.js +751 -0
- package/node_modules/fast-json-stringify/test/any.test.js +231 -0
- package/node_modules/fast-json-stringify/test/anyof.test.js +792 -0
- package/node_modules/fast-json-stringify/test/array.test.js +666 -0
- package/node_modules/fast-json-stringify/test/asNumber.test.js +13 -0
- package/node_modules/fast-json-stringify/test/basic.test.js +400 -0
- package/node_modules/fast-json-stringify/test/bigint.test.js +76 -0
- package/node_modules/fast-json-stringify/test/clean-cache.test.js +47 -0
- package/node_modules/fast-json-stringify/test/const.test.js +314 -0
- package/node_modules/fast-json-stringify/test/date.test.js +639 -0
- package/node_modules/fast-json-stringify/test/debug-mode.test.js +121 -0
- package/node_modules/fast-json-stringify/test/defaults.test.js +376 -0
- package/node_modules/fast-json-stringify/test/enum.test.js +37 -0
- package/node_modules/fast-json-stringify/test/fix-604.test.js +25 -0
- package/node_modules/fast-json-stringify/test/fixtures/.keep +0 -0
- package/node_modules/fast-json-stringify/test/if-then-else.test.js +468 -0
- package/node_modules/fast-json-stringify/test/inferType.test.js +92 -0
- package/node_modules/fast-json-stringify/test/infinity.test.js +55 -0
- package/node_modules/fast-json-stringify/test/integer.test.js +194 -0
- package/node_modules/fast-json-stringify/test/invalidSchema.test.js +18 -0
- package/node_modules/fast-json-stringify/test/issue-479.test.js +57 -0
- package/node_modules/fast-json-stringify/test/issue-793.test.js +107 -0
- package/node_modules/fast-json-stringify/test/issue-794.test.js +177 -0
- package/node_modules/fast-json-stringify/test/json-add-comma.test.js +57 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/README.md +10 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft4/required.json +54 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft4.test.js +12 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft6/required.json +70 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft6.test.js +12 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft7/required.json +70 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/draft7.test.js +12 -0
- package/node_modules/fast-json-stringify/test/json-schema-test-suite/util.js +31 -0
- package/node_modules/fast-json-stringify/test/missing-values.test.js +88 -0
- package/node_modules/fast-json-stringify/test/multi-type-serializer.test.js +19 -0
- package/node_modules/fast-json-stringify/test/nestedObjects.test.js +63 -0
- package/node_modules/fast-json-stringify/test/nullable.test.js +543 -0
- package/node_modules/fast-json-stringify/test/oneof.test.js +490 -0
- package/node_modules/fast-json-stringify/test/patternProperties.test.js +168 -0
- package/node_modules/fast-json-stringify/test/recursion.test.js +245 -0
- package/node_modules/fast-json-stringify/test/ref.json +12 -0
- package/node_modules/fast-json-stringify/test/ref.test.js +2046 -0
- package/node_modules/fast-json-stringify/test/regex.test.js +32 -0
- package/node_modules/fast-json-stringify/test/required.test.js +204 -0
- package/node_modules/fast-json-stringify/test/requiresAjv.test.js +50 -0
- package/node_modules/fast-json-stringify/test/sanitize.test.js +141 -0
- package/node_modules/fast-json-stringify/test/sanitize2.test.js +18 -0
- package/node_modules/fast-json-stringify/test/sanitize3.test.js +17 -0
- package/node_modules/fast-json-stringify/test/sanitize4.test.js +16 -0
- package/node_modules/fast-json-stringify/test/sanitize5.test.js +16 -0
- package/node_modules/fast-json-stringify/test/sanitize6.test.js +22 -0
- package/node_modules/fast-json-stringify/test/sanitize7.test.js +68 -0
- package/node_modules/fast-json-stringify/test/side-effect.test.js +196 -0
- package/node_modules/fast-json-stringify/test/standalone-mode.test.js +219 -0
- package/node_modules/fast-json-stringify/test/string.test.js +84 -0
- package/node_modules/fast-json-stringify/test/surrogate.test.js +67 -0
- package/node_modules/fast-json-stringify/test/toJSON.test.js +203 -0
- package/node_modules/fast-json-stringify/test/typebox.test.js +36 -0
- package/node_modules/fast-json-stringify/test/typesArray.test.js +550 -0
- package/node_modules/fast-json-stringify/test/unknownFormats.test.js +27 -0
- package/node_modules/fast-json-stringify/test/webpack.test.js +50 -0
- package/node_modules/fast-json-stringify/types/index.d.ts +231 -0
- package/node_modules/fast-json-stringify/types/index.test-d.ts +259 -0
- package/node_modules/fast-querystring/LICENSE +25 -0
- package/node_modules/fast-querystring/README.md +114 -0
- package/node_modules/fast-querystring/lib/index.d.ts +14 -0
- package/node_modules/fast-querystring/lib/index.js +20 -0
- package/node_modules/fast-querystring/lib/internals/querystring.js +96 -0
- package/node_modules/fast-querystring/lib/parse.js +126 -0
- package/node_modules/fast-querystring/lib/stringify.js +69 -0
- package/node_modules/fast-querystring/package.json +56 -0
- package/node_modules/fast-uri/.gitattributes +2 -0
- package/node_modules/fast-uri/.github/.stale.yml +21 -0
- package/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/node_modules/fast-uri/.github/tests_checker.yml +8 -0
- package/node_modules/fast-uri/.github/workflows/ci.yml +101 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
- package/node_modules/fast-uri/LICENSE +32 -0
- package/node_modules/fast-uri/README.md +143 -0
- package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/node_modules/fast-uri/benchmark/package.json +17 -0
- package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/node_modules/fast-uri/eslint.config.js +6 -0
- package/node_modules/fast-uri/index.js +340 -0
- package/node_modules/fast-uri/lib/schemes.js +267 -0
- package/node_modules/fast-uri/lib/utils.js +336 -0
- package/node_modules/fast-uri/package.json +69 -0
- package/node_modules/fast-uri/test/ajv.test.js +43 -0
- package/node_modules/fast-uri/test/equal.test.js +108 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/node_modules/fast-uri/test/parse.test.js +318 -0
- package/node_modules/fast-uri/test/resolve.test.js +78 -0
- package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/node_modules/fast-uri/test/serialize.test.js +151 -0
- package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/node_modules/fast-uri/test/uri-js.test.js +912 -0
- package/node_modules/fast-uri/test/util.test.js +38 -0
- package/node_modules/fast-uri/tsconfig.json +9 -0
- package/node_modules/fast-uri/types/index.d.ts +60 -0
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/fastify/.borp.yaml +3 -0
- package/node_modules/fastify/.markdownlint-cli2.yaml +22 -0
- package/node_modules/fastify/.prettierignore +1 -0
- package/node_modules/fastify/AGENTS.md +290 -0
- package/node_modules/fastify/GOVERNANCE.md +4 -0
- package/node_modules/fastify/LICENSE +21 -0
- package/node_modules/fastify/PROJECT_CHARTER.md +126 -0
- package/node_modules/fastify/README.md +422 -0
- package/node_modules/fastify/SECURITY.md +211 -0
- package/node_modules/fastify/SPONSORS.md +24 -0
- package/node_modules/fastify/build/build-error-serializer.js +35 -0
- package/node_modules/fastify/build/build-validation.js +167 -0
- package/node_modules/fastify/build/sync-version.js +11 -0
- package/node_modules/fastify/docs/Guides/Benchmarking.md +60 -0
- package/node_modules/fastify/docs/Guides/Database.md +321 -0
- package/node_modules/fastify/docs/Guides/Delay-Accepting-Requests.md +608 -0
- package/node_modules/fastify/docs/Guides/Detecting-When-Clients-Abort.md +172 -0
- package/node_modules/fastify/docs/Guides/Ecosystem.md +768 -0
- package/node_modules/fastify/docs/Guides/Fluent-Schema.md +126 -0
- package/node_modules/fastify/docs/Guides/Getting-Started.md +620 -0
- package/node_modules/fastify/docs/Guides/Index.md +43 -0
- package/node_modules/fastify/docs/Guides/Migration-Guide-V3.md +287 -0
- package/node_modules/fastify/docs/Guides/Migration-Guide-V4.md +271 -0
- package/node_modules/fastify/docs/Guides/Migration-Guide-V5.md +727 -0
- package/node_modules/fastify/docs/Guides/Plugins-Guide.md +520 -0
- package/node_modules/fastify/docs/Guides/Prototype-Poisoning.md +383 -0
- package/node_modules/fastify/docs/Guides/Recommendations.md +353 -0
- package/node_modules/fastify/docs/Guides/Serverless.md +604 -0
- package/node_modules/fastify/docs/Guides/Style-Guide.md +246 -0
- package/node_modules/fastify/docs/Guides/Testing.md +481 -0
- package/node_modules/fastify/docs/Guides/Write-Plugin.md +103 -0
- package/node_modules/fastify/docs/Guides/Write-Type-Provider.md +34 -0
- package/node_modules/fastify/docs/Reference/ContentTypeParser.md +255 -0
- package/node_modules/fastify/docs/Reference/Decorators.md +434 -0
- package/node_modules/fastify/docs/Reference/Encapsulation.md +194 -0
- package/node_modules/fastify/docs/Reference/Errors.md +372 -0
- package/node_modules/fastify/docs/Reference/HTTP2.md +94 -0
- package/node_modules/fastify/docs/Reference/Hooks.md +896 -0
- package/node_modules/fastify/docs/Reference/Index.md +73 -0
- package/node_modules/fastify/docs/Reference/LTS.md +86 -0
- package/node_modules/fastify/docs/Reference/Lifecycle.md +84 -0
- package/node_modules/fastify/docs/Reference/Logging.md +264 -0
- package/node_modules/fastify/docs/Reference/Middleware.md +78 -0
- package/node_modules/fastify/docs/Reference/Plugins.md +245 -0
- package/node_modules/fastify/docs/Reference/Principles.md +73 -0
- package/node_modules/fastify/docs/Reference/Reply.md +994 -0
- package/node_modules/fastify/docs/Reference/Request.md +279 -0
- package/node_modules/fastify/docs/Reference/Routes.md +793 -0
- package/node_modules/fastify/docs/Reference/Server.md +2265 -0
- package/node_modules/fastify/docs/Reference/Type-Providers.md +256 -0
- package/node_modules/fastify/docs/Reference/TypeScript.md +1725 -0
- package/node_modules/fastify/docs/Reference/Validation-and-Serialization.md +1057 -0
- package/node_modules/fastify/docs/Reference/Warnings.md +58 -0
- package/node_modules/fastify/docs/index.md +24 -0
- package/node_modules/fastify/docs/resources/encapsulation_context.drawio +1 -0
- package/node_modules/fastify/docs/resources/encapsulation_context.svg +3 -0
- package/node_modules/fastify/eslint.config.js +35 -0
- package/node_modules/fastify/examples/asyncawait.js +38 -0
- package/node_modules/fastify/examples/benchmark/body.json +3 -0
- package/node_modules/fastify/examples/benchmark/hooks-benchmark-async-await.js +44 -0
- package/node_modules/fastify/examples/benchmark/hooks-benchmark.js +52 -0
- package/node_modules/fastify/examples/benchmark/parser.js +47 -0
- package/node_modules/fastify/examples/benchmark/simple.js +30 -0
- package/node_modules/fastify/examples/benchmark/webstream.js +27 -0
- package/node_modules/fastify/examples/hooks.js +91 -0
- package/node_modules/fastify/examples/http2.js +39 -0
- package/node_modules/fastify/examples/https.js +38 -0
- package/node_modules/fastify/examples/parser.js +53 -0
- package/node_modules/fastify/examples/plugin.js +12 -0
- package/node_modules/fastify/examples/route-prefix.js +38 -0
- package/node_modules/fastify/examples/shared-schema.js +38 -0
- package/node_modules/fastify/examples/simple-stream.js +20 -0
- package/node_modules/fastify/examples/simple.js +32 -0
- package/node_modules/fastify/examples/simple.mjs +27 -0
- package/node_modules/fastify/examples/typescript-server.ts +79 -0
- package/node_modules/fastify/examples/use-plugin.js +29 -0
- package/node_modules/fastify/fastify.d.ts +252 -0
- package/node_modules/fastify/fastify.js +983 -0
- package/node_modules/fastify/integration/server.js +29 -0
- package/node_modules/fastify/integration/test.sh +23 -0
- package/node_modules/fastify/lib/config-validator.js +1238 -0
- package/node_modules/fastify/lib/content-type-parser.js +413 -0
- package/node_modules/fastify/lib/content-type.js +152 -0
- package/node_modules/fastify/lib/context.js +95 -0
- package/node_modules/fastify/lib/decorate.js +152 -0
- package/node_modules/fastify/lib/error-handler.js +173 -0
- package/node_modules/fastify/lib/error-serializer.js +134 -0
- package/node_modules/fastify/lib/error-status.js +14 -0
- package/node_modules/fastify/lib/errors.js +505 -0
- package/node_modules/fastify/lib/four-oh-four.js +190 -0
- package/node_modules/fastify/lib/handle-request.js +195 -0
- package/node_modules/fastify/lib/head-route.js +45 -0
- package/node_modules/fastify/lib/hooks.js +429 -0
- package/node_modules/fastify/lib/initial-config-validation.js +37 -0
- package/node_modules/fastify/lib/logger-factory.js +136 -0
- package/node_modules/fastify/lib/logger-pino.js +68 -0
- package/node_modules/fastify/lib/noop-set.js +10 -0
- package/node_modules/fastify/lib/plugin-override.js +90 -0
- package/node_modules/fastify/lib/plugin-utils.js +169 -0
- package/node_modules/fastify/lib/promise.js +23 -0
- package/node_modules/fastify/lib/reply.js +1008 -0
- package/node_modules/fastify/lib/req-id-gen-factory.js +52 -0
- package/node_modules/fastify/lib/request.js +374 -0
- package/node_modules/fastify/lib/route.js +645 -0
- package/node_modules/fastify/lib/schema-controller.js +164 -0
- package/node_modules/fastify/lib/schemas.js +207 -0
- package/node_modules/fastify/lib/server.js +441 -0
- package/node_modules/fastify/lib/symbols.js +67 -0
- package/node_modules/fastify/lib/validation.js +280 -0
- package/node_modules/fastify/lib/warnings.js +57 -0
- package/node_modules/fastify/lib/wrap-thenable.js +84 -0
- package/node_modules/fastify/node_modules/semver/LICENSE +15 -0
- package/node_modules/fastify/node_modules/semver/README.md +665 -0
- package/node_modules/fastify/node_modules/semver/bin/semver.js +191 -0
- package/node_modules/fastify/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/fastify/node_modules/semver/classes/index.js +7 -0
- package/node_modules/fastify/node_modules/semver/classes/range.js +557 -0
- package/node_modules/fastify/node_modules/semver/classes/semver.js +333 -0
- package/node_modules/fastify/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/fastify/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/fastify/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/fastify/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/fastify/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/fastify/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/fastify/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/fastify/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/major.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/fastify/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/fastify/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/fastify/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/fastify/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/fastify/node_modules/semver/index.js +91 -0
- package/node_modules/fastify/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/fastify/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/fastify/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/fastify/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/fastify/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/fastify/node_modules/semver/internal/re.js +223 -0
- package/node_modules/fastify/node_modules/semver/package.json +78 -0
- package/node_modules/fastify/node_modules/semver/preload.js +4 -0
- package/node_modules/fastify/node_modules/semver/range.bnf +16 -0
- package/node_modules/fastify/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/fastify/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/fastify/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/fastify/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/fastify/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/fastify/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/fastify/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/fastify/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/fastify/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/fastify/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/fastify/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/fastify/package.json +225 -0
- package/node_modules/fastify/test/404s.test.js +2035 -0
- package/node_modules/fastify/test/500s.test.js +422 -0
- package/node_modules/fastify/test/allow-unsafe-regex.test.js +92 -0
- package/node_modules/fastify/test/als.test.js +65 -0
- package/node_modules/fastify/test/async-await.test.js +705 -0
- package/node_modules/fastify/test/async-dispose.test.js +20 -0
- package/node_modules/fastify/test/async_hooks.test.js +52 -0
- package/node_modules/fastify/test/body-limit.test.js +224 -0
- package/node_modules/fastify/test/buffer.test.js +74 -0
- package/node_modules/fastify/test/build/error-serializer.test.js +36 -0
- package/node_modules/fastify/test/build/version.test.js +14 -0
- package/node_modules/fastify/test/build-certificate.js +109 -0
- package/node_modules/fastify/test/bundler/README.md +29 -0
- package/node_modules/fastify/test/bundler/esbuild/bundler-test.js +32 -0
- package/node_modules/fastify/test/bundler/esbuild/package.json +10 -0
- package/node_modules/fastify/test/bundler/esbuild/src/fail-plugin-version.js +14 -0
- package/node_modules/fastify/test/bundler/esbuild/src/index.js +9 -0
- package/node_modules/fastify/test/bundler/webpack/bundler-test.js +32 -0
- package/node_modules/fastify/test/bundler/webpack/package.json +11 -0
- package/node_modules/fastify/test/bundler/webpack/src/fail-plugin-version.js +14 -0
- package/node_modules/fastify/test/bundler/webpack/src/index.js +9 -0
- package/node_modules/fastify/test/bundler/webpack/webpack.config.js +15 -0
- package/node_modules/fastify/test/case-insensitive.test.js +102 -0
- package/node_modules/fastify/test/chainable.test.js +40 -0
- package/node_modules/fastify/test/child-logger-factory.test.js +128 -0
- package/node_modules/fastify/test/client-timeout.test.js +38 -0
- package/node_modules/fastify/test/close-pipelining.test.js +78 -0
- package/node_modules/fastify/test/close.test.js +706 -0
- package/node_modules/fastify/test/conditional-pino.test.js +47 -0
- package/node_modules/fastify/test/connection-timeout.test.js +42 -0
- package/node_modules/fastify/test/constrained-routes.test.js +1138 -0
- package/node_modules/fastify/test/content-length.test.js +174 -0
- package/node_modules/fastify/test/content-parser.test.js +715 -0
- package/node_modules/fastify/test/content-type.test.js +143 -0
- package/node_modules/fastify/test/context-config.test.js +164 -0
- package/node_modules/fastify/test/custom-http-server.test.js +118 -0
- package/node_modules/fastify/test/custom-parser-async.test.js +59 -0
- package/node_modules/fastify/test/custom-parser.0.test.js +701 -0
- package/node_modules/fastify/test/custom-parser.1.test.js +266 -0
- package/node_modules/fastify/test/custom-parser.2.test.js +91 -0
- package/node_modules/fastify/test/custom-parser.3.test.js +208 -0
- package/node_modules/fastify/test/custom-parser.4.test.js +218 -0
- package/node_modules/fastify/test/custom-parser.5.test.js +130 -0
- package/node_modules/fastify/test/custom-querystring-parser.test.js +129 -0
- package/node_modules/fastify/test/decorator.test.js +1330 -0
- package/node_modules/fastify/test/delete.test.js +344 -0
- package/node_modules/fastify/test/diagnostics-channel/404.test.js +49 -0
- package/node_modules/fastify/test/diagnostics-channel/async-delay-request.test.js +65 -0
- package/node_modules/fastify/test/diagnostics-channel/async-request.test.js +64 -0
- package/node_modules/fastify/test/diagnostics-channel/error-before-handler.test.js +35 -0
- package/node_modules/fastify/test/diagnostics-channel/error-request.test.js +53 -0
- package/node_modules/fastify/test/diagnostics-channel/error-status.test.js +123 -0
- package/node_modules/fastify/test/diagnostics-channel/init.test.js +50 -0
- package/node_modules/fastify/test/diagnostics-channel/sync-delay-request.test.js +49 -0
- package/node_modules/fastify/test/diagnostics-channel/sync-request-reply.test.js +51 -0
- package/node_modules/fastify/test/diagnostics-channel/sync-request.test.js +54 -0
- package/node_modules/fastify/test/encapsulated-child-logger-factory.test.js +69 -0
- package/node_modules/fastify/test/encapsulated-error-handler.test.js +237 -0
- package/node_modules/fastify/test/esm/errorCodes.test.mjs +10 -0
- package/node_modules/fastify/test/esm/esm.test.mjs +13 -0
- package/node_modules/fastify/test/esm/index.test.js +8 -0
- package/node_modules/fastify/test/esm/named-exports.mjs +14 -0
- package/node_modules/fastify/test/esm/other.mjs +8 -0
- package/node_modules/fastify/test/esm/plugin.mjs +8 -0
- package/node_modules/fastify/test/fastify-instance.test.js +300 -0
- package/node_modules/fastify/test/find-route.test.js +152 -0
- package/node_modules/fastify/test/fluent-schema.test.js +209 -0
- package/node_modules/fastify/test/genReqId.test.js +426 -0
- package/node_modules/fastify/test/handler-context.test.js +45 -0
- package/node_modules/fastify/test/has-route.test.js +88 -0
- package/node_modules/fastify/test/header-overflow.test.js +55 -0
- package/node_modules/fastify/test/helper.js +496 -0
- package/node_modules/fastify/test/hooks-async.test.js +1099 -0
- package/node_modules/fastify/test/hooks.on-listen.test.js +1162 -0
- package/node_modules/fastify/test/hooks.on-ready.test.js +421 -0
- package/node_modules/fastify/test/hooks.test.js +3578 -0
- package/node_modules/fastify/test/http-methods/copy.test.js +35 -0
- package/node_modules/fastify/test/http-methods/custom-http-methods.test.js +114 -0
- package/node_modules/fastify/test/http-methods/get.test.js +412 -0
- package/node_modules/fastify/test/http-methods/head.test.js +263 -0
- package/node_modules/fastify/test/http-methods/lock.test.js +108 -0
- package/node_modules/fastify/test/http-methods/mkcalendar.test.js +143 -0
- package/node_modules/fastify/test/http-methods/mkcol.test.js +35 -0
- package/node_modules/fastify/test/http-methods/move.test.js +42 -0
- package/node_modules/fastify/test/http-methods/propfind.test.js +136 -0
- package/node_modules/fastify/test/http-methods/proppatch.test.js +105 -0
- package/node_modules/fastify/test/http-methods/report.test.js +142 -0
- package/node_modules/fastify/test/http-methods/search.test.js +233 -0
- package/node_modules/fastify/test/http-methods/trace.test.js +21 -0
- package/node_modules/fastify/test/http-methods/unlock.test.js +38 -0
- package/node_modules/fastify/test/http2/closing.test.js +270 -0
- package/node_modules/fastify/test/http2/constraint.test.js +109 -0
- package/node_modules/fastify/test/http2/head.test.js +34 -0
- package/node_modules/fastify/test/http2/plain.test.js +68 -0
- package/node_modules/fastify/test/http2/secure-with-fallback.test.js +113 -0
- package/node_modules/fastify/test/http2/secure.test.js +67 -0
- package/node_modules/fastify/test/http2/unknown-http-method.test.js +34 -0
- package/node_modules/fastify/test/https/custom-https-server.test.js +58 -0
- package/node_modules/fastify/test/https/https.test.js +136 -0
- package/node_modules/fastify/test/imports.test.js +17 -0
- package/node_modules/fastify/test/inject.test.js +502 -0
- package/node_modules/fastify/test/input-validation.js +335 -0
- package/node_modules/fastify/test/internals/all.test.js +38 -0
- package/node_modules/fastify/test/internals/content-type-parser.test.js +111 -0
- package/node_modules/fastify/test/internals/context.test.js +31 -0
- package/node_modules/fastify/test/internals/decorator.test.js +156 -0
- package/node_modules/fastify/test/internals/errors.test.js +982 -0
- package/node_modules/fastify/test/internals/handle-request.test.js +270 -0
- package/node_modules/fastify/test/internals/hook-runner.test.js +449 -0
- package/node_modules/fastify/test/internals/hooks.test.js +96 -0
- package/node_modules/fastify/test/internals/initial-config.test.js +381 -0
- package/node_modules/fastify/test/internals/logger.test.js +163 -0
- package/node_modules/fastify/test/internals/plugin.test.js +170 -0
- package/node_modules/fastify/test/internals/promise.test.js +63 -0
- package/node_modules/fastify/test/internals/reply-serialize.test.js +714 -0
- package/node_modules/fastify/test/internals/reply.test.js +1920 -0
- package/node_modules/fastify/test/internals/req-id-gen-factory.test.js +133 -0
- package/node_modules/fastify/test/internals/request-validate.test.js +1402 -0
- package/node_modules/fastify/test/internals/request.test.js +506 -0
- package/node_modules/fastify/test/internals/schema-controller-perf.test.js +40 -0
- package/node_modules/fastify/test/internals/server.test.js +91 -0
- package/node_modules/fastify/test/internals/validation.test.js +352 -0
- package/node_modules/fastify/test/issue-4959.test.js +118 -0
- package/node_modules/fastify/test/keep-alive-timeout.test.js +42 -0
- package/node_modules/fastify/test/listen.1.test.js +154 -0
- package/node_modules/fastify/test/listen.2.test.js +113 -0
- package/node_modules/fastify/test/listen.3.test.js +83 -0
- package/node_modules/fastify/test/listen.4.test.js +168 -0
- package/node_modules/fastify/test/listen.5.test.js +122 -0
- package/node_modules/fastify/test/logger/instantiation.test.js +341 -0
- package/node_modules/fastify/test/logger/logger-test-utils.js +47 -0
- package/node_modules/fastify/test/logger/logging.test.js +460 -0
- package/node_modules/fastify/test/logger/options.test.js +579 -0
- package/node_modules/fastify/test/logger/request.test.js +292 -0
- package/node_modules/fastify/test/logger/response.test.js +183 -0
- package/node_modules/fastify/test/logger/tap-parallel-not-ok +0 -0
- package/node_modules/fastify/test/max-requests-per-socket.test.js +113 -0
- package/node_modules/fastify/test/middleware.test.js +37 -0
- package/node_modules/fastify/test/noop-set.test.js +19 -0
- package/node_modules/fastify/test/nullable-validation.test.js +187 -0
- package/node_modules/fastify/test/options.error-handler.test.js +5 -0
- package/node_modules/fastify/test/options.test.js +5 -0
- package/node_modules/fastify/test/output-validation.test.js +140 -0
- package/node_modules/fastify/test/patch.error-handler.test.js +5 -0
- package/node_modules/fastify/test/patch.test.js +5 -0
- package/node_modules/fastify/test/plugin.1.test.js +230 -0
- package/node_modules/fastify/test/plugin.2.test.js +314 -0
- package/node_modules/fastify/test/plugin.3.test.js +287 -0
- package/node_modules/fastify/test/plugin.4.test.js +504 -0
- package/node_modules/fastify/test/plugin.helper.js +8 -0
- package/node_modules/fastify/test/plugin.name.display.js +10 -0
- package/node_modules/fastify/test/post-empty-body.test.js +38 -0
- package/node_modules/fastify/test/pretty-print.test.js +366 -0
- package/node_modules/fastify/test/promises.test.js +125 -0
- package/node_modules/fastify/test/proto-poisoning.test.js +145 -0
- package/node_modules/fastify/test/put.error-handler.test.js +5 -0
- package/node_modules/fastify/test/put.test.js +5 -0
- package/node_modules/fastify/test/register.test.js +184 -0
- package/node_modules/fastify/test/reply-code.test.js +148 -0
- package/node_modules/fastify/test/reply-early-hints.test.js +100 -0
- package/node_modules/fastify/test/reply-error.test.js +815 -0
- package/node_modules/fastify/test/reply-trailers.test.js +445 -0
- package/node_modules/fastify/test/reply-web-stream-locked.test.js +37 -0
- package/node_modules/fastify/test/request-error.test.js +583 -0
- package/node_modules/fastify/test/request-header-host.test.js +339 -0
- package/node_modules/fastify/test/request-id.test.js +118 -0
- package/node_modules/fastify/test/request-timeout.test.js +53 -0
- package/node_modules/fastify/test/route-hooks.test.js +635 -0
- package/node_modules/fastify/test/route-prefix.test.js +904 -0
- package/node_modules/fastify/test/route-shorthand.test.js +48 -0
- package/node_modules/fastify/test/route.1.test.js +259 -0
- package/node_modules/fastify/test/route.2.test.js +100 -0
- package/node_modules/fastify/test/route.3.test.js +213 -0
- package/node_modules/fastify/test/route.4.test.js +127 -0
- package/node_modules/fastify/test/route.5.test.js +211 -0
- package/node_modules/fastify/test/route.6.test.js +306 -0
- package/node_modules/fastify/test/route.7.test.js +406 -0
- package/node_modules/fastify/test/route.8.test.js +225 -0
- package/node_modules/fastify/test/router-options.test.js +1066 -0
- package/node_modules/fastify/test/same-shape.test.js +124 -0
- package/node_modules/fastify/test/schema-examples.test.js +661 -0
- package/node_modules/fastify/test/schema-feature.test.js +2198 -0
- package/node_modules/fastify/test/schema-serialization.test.js +1171 -0
- package/node_modules/fastify/test/schema-special-usage.test.js +1348 -0
- package/node_modules/fastify/test/schema-validation.test.js +1572 -0
- package/node_modules/fastify/test/serialize-response.test.js +186 -0
- package/node_modules/fastify/test/server.test.js +347 -0
- package/node_modules/fastify/test/set-error-handler.test.js +69 -0
- package/node_modules/fastify/test/skip-reply-send.test.js +317 -0
- package/node_modules/fastify/test/stream-serializers.test.js +40 -0
- package/node_modules/fastify/test/stream.1.test.js +94 -0
- package/node_modules/fastify/test/stream.2.test.js +129 -0
- package/node_modules/fastify/test/stream.3.test.js +198 -0
- package/node_modules/fastify/test/stream.4.test.js +176 -0
- package/node_modules/fastify/test/stream.5.test.js +188 -0
- package/node_modules/fastify/test/sync-routes.test.js +32 -0
- package/node_modules/fastify/test/throw.test.js +359 -0
- package/node_modules/fastify/test/toolkit.js +63 -0
- package/node_modules/fastify/test/trust-proxy.test.js +162 -0
- package/node_modules/fastify/test/type-provider.test.js +22 -0
- package/node_modules/fastify/test/types/content-type-parser.test-d.ts +72 -0
- package/node_modules/fastify/test/types/decorate-request-reply.test-d.ts +18 -0
- package/node_modules/fastify/test/types/dummy-plugin.ts +9 -0
- package/node_modules/fastify/test/types/errors.test-d.ts +90 -0
- package/node_modules/fastify/test/types/fastify.test-d.ts +351 -0
- package/node_modules/fastify/test/types/hooks.test-d.ts +550 -0
- package/node_modules/fastify/test/types/import.ts +2 -0
- package/node_modules/fastify/test/types/instance.test-d.ts +588 -0
- package/node_modules/fastify/test/types/logger.test-d.ts +278 -0
- package/node_modules/fastify/test/types/plugin.test-d.ts +97 -0
- package/node_modules/fastify/test/types/register.test-d.ts +237 -0
- package/node_modules/fastify/test/types/reply.test-d.ts +254 -0
- package/node_modules/fastify/test/types/request.test-d.ts +187 -0
- package/node_modules/fastify/test/types/route.test-d.ts +547 -0
- package/node_modules/fastify/test/types/schema.test-d.ts +135 -0
- package/node_modules/fastify/test/types/serverFactory.test-d.ts +37 -0
- package/node_modules/fastify/test/types/type-provider.test-d.ts +1213 -0
- package/node_modules/fastify/test/types/using.test-d.ts +17 -0
- package/node_modules/fastify/test/upgrade.test.js +52 -0
- package/node_modules/fastify/test/url-rewriting.test.js +122 -0
- package/node_modules/fastify/test/use-semicolon-delimiter.test.js +168 -0
- package/node_modules/fastify/test/validation-error-handling.test.js +900 -0
- package/node_modules/fastify/test/versioned-routes.test.js +603 -0
- package/node_modules/fastify/test/web-api.test.js +541 -0
- package/node_modules/fastify/test/wrap-thenable.test.js +30 -0
- package/node_modules/fastify/types/content-type-parser.d.ts +75 -0
- package/node_modules/fastify/types/context.d.ts +22 -0
- package/node_modules/fastify/types/errors.d.ts +90 -0
- package/node_modules/fastify/types/hooks.d.ts +875 -0
- package/node_modules/fastify/types/instance.d.ts +609 -0
- package/node_modules/fastify/types/logger.d.ts +107 -0
- package/node_modules/fastify/types/plugin.d.ts +44 -0
- package/node_modules/fastify/types/register.d.ts +42 -0
- package/node_modules/fastify/types/reply.d.ts +81 -0
- package/node_modules/fastify/types/request.d.ts +93 -0
- package/node_modules/fastify/types/route.d.ts +185 -0
- package/node_modules/fastify/types/schema.d.ts +61 -0
- package/node_modules/fastify/types/server-factory.d.ts +19 -0
- package/node_modules/fastify/types/tsconfig.eslint.json +13 -0
- package/node_modules/fastify/types/type-provider.d.ts +130 -0
- package/node_modules/fastify/types/utils.d.ts +98 -0
- package/node_modules/fastify-plugin/.gitattributes +2 -0
- package/node_modules/fastify-plugin/.github/dependabot.yml +13 -0
- package/node_modules/fastify-plugin/.github/stale.yml +21 -0
- package/node_modules/fastify-plugin/.github/workflows/ci.yml +28 -0
- package/node_modules/fastify-plugin/LICENSE +23 -0
- package/node_modules/fastify-plugin/README.md +188 -0
- package/node_modules/fastify-plugin/eslint.config.js +6 -0
- package/node_modules/fastify-plugin/lib/getPluginName.js +25 -0
- package/node_modules/fastify-plugin/lib/toCamelCase.js +10 -0
- package/node_modules/fastify-plugin/package.json +70 -0
- package/node_modules/fastify-plugin/plugin.js +67 -0
- package/node_modules/fastify-plugin/test/bundlers.test.js +110 -0
- package/node_modules/fastify-plugin/test/checkVersion.test.js +67 -0
- package/node_modules/fastify-plugin/test/composite.test.js +14 -0
- package/node_modules/fastify-plugin/test/esm/esm.mjs +11 -0
- package/node_modules/fastify-plugin/test/esm/index.test.js +11 -0
- package/node_modules/fastify-plugin/test/extractPluginName.test.js +49 -0
- package/node_modules/fastify-plugin/test/mu1tip1e.composite.test.js +15 -0
- package/node_modules/fastify-plugin/test/test.js +396 -0
- package/node_modules/fastify-plugin/test/toCamelCase.test.js +24 -0
- package/node_modules/fastify-plugin/types/example-async.test-d.ts +19 -0
- package/node_modules/fastify-plugin/types/example-callback.test-d.ts +19 -0
- package/node_modules/fastify-plugin/types/plugin.d.ts +61 -0
- package/node_modules/fastify-plugin/types/plugin.test-d.ts +166 -0
- package/node_modules/fastq/LICENSE +13 -0
- package/node_modules/fastq/README.md +310 -0
- package/node_modules/fastq/SECURITY.md +15 -0
- package/node_modules/fastq/bench.js +66 -0
- package/node_modules/fastq/eslint.config.js +11 -0
- package/node_modules/fastq/example.js +14 -0
- package/node_modules/fastq/example.mjs +9 -0
- package/node_modules/fastq/index.d.ts +59 -0
- package/node_modules/fastq/package.json +49 -0
- package/node_modules/fastq/queue.js +346 -0
- package/node_modules/fastq/test/example.ts +83 -0
- package/node_modules/fastq/test/promise.js +325 -0
- package/node_modules/fastq/test/test.js +733 -0
- package/node_modules/fastq/test/tsconfig.json +11 -0
- package/node_modules/fill-range/LICENSE +21 -0
- package/node_modules/fill-range/README.md +237 -0
- package/node_modules/fill-range/index.js +248 -0
- package/node_modules/fill-range/package.json +74 -0
- package/node_modules/find-my-way/.github/dependabot.yml +34 -0
- package/node_modules/find-my-way/.github/workflows/node.js.yml +68 -0
- package/node_modules/find-my-way/LICENSE +21 -0
- package/node_modules/find-my-way/README.md +845 -0
- package/node_modules/find-my-way/benchmark/bench-thread.js +35 -0
- package/node_modules/find-my-way/benchmark/bench.js +156 -0
- package/node_modules/find-my-way/benchmark/compare-branches.js +113 -0
- package/node_modules/find-my-way/benchmark/uri-decoding.js +55 -0
- package/node_modules/find-my-way/example.js +29 -0
- package/node_modules/find-my-way/index.d.ts +237 -0
- package/node_modules/find-my-way/index.js +836 -0
- package/node_modules/find-my-way/lib/constrainer.js +170 -0
- package/node_modules/find-my-way/lib/handler-storage.js +174 -0
- package/node_modules/find-my-way/lib/http-methods.js +13 -0
- package/node_modules/find-my-way/lib/node.js +228 -0
- package/node_modules/find-my-way/lib/null-object.js +8 -0
- package/node_modules/find-my-way/lib/pretty-print.js +168 -0
- package/node_modules/find-my-way/lib/strategies/accept-host.js +36 -0
- package/node_modules/find-my-way/lib/strategies/accept-version.js +64 -0
- package/node_modules/find-my-way/lib/strategies/http-method.js +15 -0
- package/node_modules/find-my-way/lib/url-sanitizer.js +105 -0
- package/node_modules/find-my-way/package.json +57 -0
- package/node_modules/find-my-way/test/case-insensitive.test.js +230 -0
- package/node_modules/find-my-way/test/constraint.custom-versioning.test.js +130 -0
- package/node_modules/find-my-way/test/constraint.custom.async.test.js +111 -0
- package/node_modules/find-my-way/test/constraint.custom.test.js +273 -0
- package/node_modules/find-my-way/test/constraint.default-versioning.test.js +289 -0
- package/node_modules/find-my-way/test/constraint.host.test.js +104 -0
- package/node_modules/find-my-way/test/constraints.test.js +108 -0
- package/node_modules/find-my-way/test/custom-querystring-parser.test.js +46 -0
- package/node_modules/find-my-way/test/errors.test.js +484 -0
- package/node_modules/find-my-way/test/fastify-issue-3129.test.js +34 -0
- package/node_modules/find-my-way/test/fastify-issue-3957.test.js +23 -0
- package/node_modules/find-my-way/test/find-route.test.js +275 -0
- package/node_modules/find-my-way/test/find.test.js +16 -0
- package/node_modules/find-my-way/test/for-in-loop.test.js +13 -0
- package/node_modules/find-my-way/test/full-url.test.js +30 -0
- package/node_modules/find-my-way/test/has-route.test.js +218 -0
- package/node_modules/find-my-way/test/host-storage.test.js +27 -0
- package/node_modules/find-my-way/test/http2/constraint.host.test.js +44 -0
- package/node_modules/find-my-way/test/issue-101.test.js +31 -0
- package/node_modules/find-my-way/test/issue-104.test.js +206 -0
- package/node_modules/find-my-way/test/issue-110.test.js +31 -0
- package/node_modules/find-my-way/test/issue-132.test.js +80 -0
- package/node_modules/find-my-way/test/issue-145.test.js +24 -0
- package/node_modules/find-my-way/test/issue-149.test.js +21 -0
- package/node_modules/find-my-way/test/issue-151.test.js +54 -0
- package/node_modules/find-my-way/test/issue-154.test.js +21 -0
- package/node_modules/find-my-way/test/issue-161.test.js +88 -0
- package/node_modules/find-my-way/test/issue-17.test.js +397 -0
- package/node_modules/find-my-way/test/issue-175.test.js +80 -0
- package/node_modules/find-my-way/test/issue-182.test.js +18 -0
- package/node_modules/find-my-way/test/issue-190.test.js +44 -0
- package/node_modules/find-my-way/test/issue-20.test.js +79 -0
- package/node_modules/find-my-way/test/issue-206.test.js +121 -0
- package/node_modules/find-my-way/test/issue-221.test.js +50 -0
- package/node_modules/find-my-way/test/issue-234.test.js +94 -0
- package/node_modules/find-my-way/test/issue-238.test.js +119 -0
- package/node_modules/find-my-way/test/issue-240.test.js +30 -0
- package/node_modules/find-my-way/test/issue-241.test.js +32 -0
- package/node_modules/find-my-way/test/issue-247.test.js +51 -0
- package/node_modules/find-my-way/test/issue-254.test.js +31 -0
- package/node_modules/find-my-way/test/issue-28.test.js +618 -0
- package/node_modules/find-my-way/test/issue-280.test.js +14 -0
- package/node_modules/find-my-way/test/issue-285.test.js +37 -0
- package/node_modules/find-my-way/test/issue-330.test.js +231 -0
- package/node_modules/find-my-way/test/issue-44.test.js +149 -0
- package/node_modules/find-my-way/test/issue-46.test.js +75 -0
- package/node_modules/find-my-way/test/issue-49.test.js +108 -0
- package/node_modules/find-my-way/test/issue-59.test.js +131 -0
- package/node_modules/find-my-way/test/issue-62.test.js +28 -0
- package/node_modules/find-my-way/test/issue-63.test.js +23 -0
- package/node_modules/find-my-way/test/issue-67.test.js +50 -0
- package/node_modules/find-my-way/test/issue-93.test.js +19 -0
- package/node_modules/find-my-way/test/lookup-async.test.js +29 -0
- package/node_modules/find-my-way/test/lookup.test.js +58 -0
- package/node_modules/find-my-way/test/matching-order.test.js +17 -0
- package/node_modules/find-my-way/test/max-param-length.test.js +44 -0
- package/node_modules/find-my-way/test/methods.test.js +830 -0
- package/node_modules/find-my-way/test/null-object.test.js +36 -0
- package/node_modules/find-my-way/test/on-bad-url.test.js +72 -0
- package/node_modules/find-my-way/test/optional-params.test.js +216 -0
- package/node_modules/find-my-way/test/params-collisions.test.js +126 -0
- package/node_modules/find-my-way/test/path-params-match.test.js +53 -0
- package/node_modules/find-my-way/test/pretty-print-tree.test.js +596 -0
- package/node_modules/find-my-way/test/pretty-print.test.js +680 -0
- package/node_modules/find-my-way/test/querystring.test.js +54 -0
- package/node_modules/find-my-way/test/regex.test.js +269 -0
- package/node_modules/find-my-way/test/routes-registered.test.js +45 -0
- package/node_modules/find-my-way/test/server.test.js +368 -0
- package/node_modules/find-my-way/test/shorthands.test.js +44 -0
- package/node_modules/find-my-way/test/store.test.js +49 -0
- package/node_modules/find-my-way/test/types/router.test-d.ts +182 -0
- package/node_modules/find-my-way/test/url-sanitizer.test.js +43 -0
- package/node_modules/foreground-child/LICENSE +15 -0
- package/node_modules/foreground-child/README.md +128 -0
- package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts +2 -0
- package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/all-signals.js +58 -0
- package/node_modules/foreground-child/dist/commonjs/all-signals.js.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/index.d.ts +58 -0
- package/node_modules/foreground-child/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/index.js +123 -0
- package/node_modules/foreground-child/dist/commonjs/index.js.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/package.json +3 -0
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts +6 -0
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.js +38 -0
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts +10 -0
- package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/commonjs/watchdog.js +50 -0
- package/node_modules/foreground-child/dist/commonjs/watchdog.js.map +1 -0
- package/node_modules/foreground-child/dist/esm/all-signals.d.ts +2 -0
- package/node_modules/foreground-child/dist/esm/all-signals.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/esm/all-signals.js +52 -0
- package/node_modules/foreground-child/dist/esm/all-signals.js.map +1 -0
- package/node_modules/foreground-child/dist/esm/index.d.ts +58 -0
- package/node_modules/foreground-child/dist/esm/index.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/esm/index.js +115 -0
- package/node_modules/foreground-child/dist/esm/index.js.map +1 -0
- package/node_modules/foreground-child/dist/esm/package.json +3 -0
- package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts +6 -0
- package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/esm/proxy-signals.js +34 -0
- package/node_modules/foreground-child/dist/esm/proxy-signals.js.map +1 -0
- package/node_modules/foreground-child/dist/esm/watchdog.d.ts +10 -0
- package/node_modules/foreground-child/dist/esm/watchdog.d.ts.map +1 -0
- package/node_modules/foreground-child/dist/esm/watchdog.js +46 -0
- package/node_modules/foreground-child/dist/esm/watchdog.js.map +1 -0
- package/node_modules/foreground-child/package.json +106 -0
- package/node_modules/glob/LICENSE.md +63 -0
- package/node_modules/glob/README.md +1294 -0
- package/node_modules/glob/dist/commonjs/glob.d.ts +388 -0
- package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/glob.js +247 -0
- package/node_modules/glob/dist/commonjs/glob.js.map +1 -0
- package/node_modules/glob/dist/commonjs/has-magic.d.ts +14 -0
- package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/node_modules/glob/dist/commonjs/has-magic.js.map +1 -0
- package/node_modules/glob/dist/commonjs/ignore.d.ts +24 -0
- package/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/node_modules/glob/dist/commonjs/ignore.js.map +1 -0
- package/node_modules/glob/dist/commonjs/index.d.ts +97 -0
- package/node_modules/glob/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/index.js +68 -0
- package/node_modules/glob/dist/commonjs/index.js.map +1 -0
- package/node_modules/glob/dist/commonjs/package.json +3 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts +76 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/pattern.js +219 -0
- package/node_modules/glob/dist/commonjs/pattern.js.map +1 -0
- package/node_modules/glob/dist/commonjs/processor.d.ts +59 -0
- package/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/node_modules/glob/dist/commonjs/processor.js.map +1 -0
- package/node_modules/glob/dist/commonjs/walker.d.ts +97 -0
- package/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/node_modules/glob/dist/commonjs/walker.js.map +1 -0
- package/node_modules/glob/dist/esm/bin.d.mts +3 -0
- package/node_modules/glob/dist/esm/bin.d.mts.map +1 -0
- package/node_modules/glob/dist/esm/bin.mjs +346 -0
- package/node_modules/glob/dist/esm/bin.mjs.map +1 -0
- package/node_modules/glob/dist/esm/glob.d.ts +388 -0
- package/node_modules/glob/dist/esm/glob.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/glob.js +243 -0
- package/node_modules/glob/dist/esm/glob.js.map +1 -0
- package/node_modules/glob/dist/esm/has-magic.d.ts +14 -0
- package/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/has-magic.js +23 -0
- package/node_modules/glob/dist/esm/has-magic.js.map +1 -0
- package/node_modules/glob/dist/esm/ignore.d.ts +24 -0
- package/node_modules/glob/dist/esm/ignore.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/ignore.js +115 -0
- package/node_modules/glob/dist/esm/ignore.js.map +1 -0
- package/node_modules/glob/dist/esm/index.d.ts +97 -0
- package/node_modules/glob/dist/esm/index.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/index.js +55 -0
- package/node_modules/glob/dist/esm/index.js.map +1 -0
- package/node_modules/glob/dist/esm/package.json +3 -0
- package/node_modules/glob/dist/esm/pattern.d.ts +76 -0
- package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/pattern.js +215 -0
- package/node_modules/glob/dist/esm/pattern.js.map +1 -0
- package/node_modules/glob/dist/esm/processor.d.ts +59 -0
- package/node_modules/glob/dist/esm/processor.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/processor.js +294 -0
- package/node_modules/glob/dist/esm/processor.js.map +1 -0
- package/node_modules/glob/dist/esm/walker.d.ts +97 -0
- package/node_modules/glob/dist/esm/walker.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/walker.js +381 -0
- package/node_modules/glob/dist/esm/walker.js.map +1 -0
- package/node_modules/glob/package.json +97 -0
- package/node_modules/glob-parent/LICENSE +15 -0
- package/node_modules/glob-parent/README.md +137 -0
- package/node_modules/glob-parent/index.js +42 -0
- package/node_modules/glob-parent/package.json +48 -0
- package/node_modules/http-errors/HISTORY.md +186 -0
- package/node_modules/http-errors/LICENSE +23 -0
- package/node_modules/http-errors/README.md +169 -0
- package/node_modules/http-errors/index.js +290 -0
- package/node_modules/http-errors/package.json +54 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/ipaddr.js/LICENSE +19 -0
- package/node_modules/ipaddr.js/README.md +233 -0
- package/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/node_modules/ipaddr.js/lib/ipaddr.js +1067 -0
- package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +72 -0
- package/node_modules/ipaddr.js/package.json +36 -0
- package/node_modules/is-extglob/LICENSE +21 -0
- package/node_modules/is-extglob/README.md +107 -0
- package/node_modules/is-extglob/index.js +20 -0
- package/node_modules/is-extglob/package.json +69 -0
- package/node_modules/is-glob/LICENSE +21 -0
- package/node_modules/is-glob/README.md +206 -0
- package/node_modules/is-glob/index.js +150 -0
- package/node_modules/is-glob/package.json +81 -0
- package/node_modules/is-number/LICENSE +21 -0
- package/node_modules/is-number/README.md +187 -0
- package/node_modules/is-number/index.js +18 -0
- package/node_modules/is-number/package.json +82 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +31 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/jackspeak/LICENSE.md +55 -0
- package/node_modules/jackspeak/README.md +394 -0
- package/node_modules/jackspeak/dist/commonjs/index.d.ts +323 -0
- package/node_modules/jackspeak/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/jackspeak/dist/commonjs/index.js +944 -0
- package/node_modules/jackspeak/dist/commonjs/index.js.map +1 -0
- package/node_modules/jackspeak/dist/commonjs/index.min.js +33 -0
- package/node_modules/jackspeak/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/jackspeak/dist/commonjs/package.json +3 -0
- package/node_modules/jackspeak/dist/esm/index.d.ts +323 -0
- package/node_modules/jackspeak/dist/esm/index.d.ts.map +1 -0
- package/node_modules/jackspeak/dist/esm/index.js +936 -0
- package/node_modules/jackspeak/dist/esm/index.js.map +1 -0
- package/node_modules/jackspeak/dist/esm/index.min.js +33 -0
- package/node_modules/jackspeak/dist/esm/index.min.js.map +7 -0
- package/node_modules/jackspeak/dist/esm/package.json +3 -0
- package/node_modules/jackspeak/package.json +115 -0
- package/node_modules/json-schema-ref-resolver/.gitattributes +2 -0
- package/node_modules/json-schema-ref-resolver/.github/dependabot.yml +13 -0
- package/node_modules/json-schema-ref-resolver/.github/workflows/ci.yml +25 -0
- package/node_modules/json-schema-ref-resolver/LICENSE +21 -0
- package/node_modules/json-schema-ref-resolver/README.md +406 -0
- package/node_modules/json-schema-ref-resolver/eslint.config.js +6 -0
- package/node_modules/json-schema-ref-resolver/index.js +284 -0
- package/node_modules/json-schema-ref-resolver/package.json +76 -0
- package/node_modules/json-schema-ref-resolver/test/anchor.test.js +56 -0
- package/node_modules/json-schema-ref-resolver/test/collisions.test.js +199 -0
- package/node_modules/json-schema-ref-resolver/test/deref-schema.test.js +287 -0
- package/node_modules/json-schema-ref-resolver/test/get-deref-schema.test.js +363 -0
- package/node_modules/json-schema-ref-resolver/test/get-schema-dependencies.test.js +158 -0
- package/node_modules/json-schema-ref-resolver/test/get-schema-refs.test.js +87 -0
- package/node_modules/json-schema-ref-resolver/test/get-schema.test.js +222 -0
- package/node_modules/json-schema-ref-resolver/test/has-schema.test.js +28 -0
- package/node_modules/json-schema-ref-resolver/types/index.d.ts +67 -0
- package/node_modules/json-schema-ref-resolver/types/index.test-d.ts +23 -0
- package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/node_modules/json-schema-traverse/LICENSE +21 -0
- package/node_modules/json-schema-traverse/README.md +95 -0
- package/node_modules/json-schema-traverse/index.d.ts +40 -0
- package/node_modules/json-schema-traverse/index.js +93 -0
- package/node_modules/json-schema-traverse/package.json +43 -0
- package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/node_modules/light-my-request/.gitattributes +2 -0
- package/node_modules/light-my-request/.github/dependabot.yml +13 -0
- package/node_modules/light-my-request/.github/stale.yml +21 -0
- package/node_modules/light-my-request/.github/workflows/benchmark.yml +30 -0
- package/node_modules/light-my-request/.github/workflows/ci.yml +23 -0
- package/node_modules/light-my-request/LICENSE +32 -0
- package/node_modules/light-my-request/README.md +261 -0
- package/node_modules/light-my-request/benchmark/benchmark.js +164 -0
- package/node_modules/light-my-request/build/build-validation.js +100 -0
- package/node_modules/light-my-request/eslint.config.js +9 -0
- package/node_modules/light-my-request/index.js +194 -0
- package/node_modules/light-my-request/lib/config-validator.js +919 -0
- package/node_modules/light-my-request/lib/form-data.js +79 -0
- package/node_modules/light-my-request/lib/parse-url.js +47 -0
- package/node_modules/light-my-request/lib/request.js +290 -0
- package/node_modules/light-my-request/lib/response.js +240 -0
- package/node_modules/light-my-request/node_modules/process-warning/.gitattributes +2 -0
- package/node_modules/light-my-request/node_modules/process-warning/.github/dependabot.yml +13 -0
- package/node_modules/light-my-request/node_modules/process-warning/.github/workflows/ci.yml +24 -0
- package/node_modules/light-my-request/node_modules/process-warning/.taprc +2 -0
- package/node_modules/light-my-request/node_modules/process-warning/LICENSE +21 -0
- package/node_modules/light-my-request/node_modules/process-warning/README.md +118 -0
- package/node_modules/light-my-request/node_modules/process-warning/benchmarks/warn.js +25 -0
- package/node_modules/light-my-request/node_modules/process-warning/eslint.config.js +6 -0
- package/node_modules/light-my-request/node_modules/process-warning/examples/example.js +11 -0
- package/node_modules/light-my-request/node_modules/process-warning/index.js +124 -0
- package/node_modules/light-my-request/node_modules/process-warning/package.json +73 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-interpolated-string.test.js +29 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-once-only.test.js +28 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-reset.test.js +36 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-set.test.js +30 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/emit-unlimited.test.js +37 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/index.test.js +99 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/issue-88.test.js +33 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/jest.test.js +22 -0
- package/node_modules/light-my-request/node_modules/process-warning/test/no-warnings.test.js +80 -0
- package/node_modules/light-my-request/node_modules/process-warning/types/index.d.ts +37 -0
- package/node_modules/light-my-request/node_modules/process-warning/types/index.test-d.ts +36 -0
- package/node_modules/light-my-request/package.json +85 -0
- package/node_modules/light-my-request/test/async-await.test.js +55 -0
- package/node_modules/light-my-request/test/index.test.js +2316 -0
- package/node_modules/light-my-request/test/request.test.js +16 -0
- package/node_modules/light-my-request/test/response.test.js +19 -0
- package/node_modules/light-my-request/test/stream.test.js +359 -0
- package/node_modules/light-my-request/types/index.d.ts +128 -0
- package/node_modules/light-my-request/types/index.test-d.ts +149 -0
- package/node_modules/merge2/LICENSE +21 -0
- package/node_modules/merge2/README.md +144 -0
- package/node_modules/merge2/index.js +144 -0
- package/node_modules/merge2/package.json +43 -0
- package/node_modules/micromatch/LICENSE +21 -0
- package/node_modules/micromatch/README.md +1024 -0
- package/node_modules/micromatch/index.js +474 -0
- package/node_modules/micromatch/package.json +119 -0
- package/node_modules/mime/LICENSE +21 -0
- package/node_modules/mime/Mime.js +97 -0
- package/node_modules/mime/README.md +178 -0
- package/node_modules/mime/cli.js +46 -0
- package/node_modules/mime/index.js +4 -0
- package/node_modules/mime/lite.js +4 -0
- package/node_modules/mime/package.json +52 -0
- package/node_modules/mime/types/other.js +1 -0
- package/node_modules/mime/types/standard.js +1 -0
- package/node_modules/minimatch/LICENSE.md +55 -0
- package/node_modules/minimatch/README.md +453 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts +20 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.js +591 -0
- package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts +94 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.js +1029 -0
- package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts +20 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.js +587 -0
- package/node_modules/minimatch/dist/esm/ast.js.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js +148 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/index.d.ts +94 -0
- package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/index.js +1016 -0
- package/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/node_modules/minimatch/dist/esm/package.json +3 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/node_modules/minimatch/package.json +67 -0
- package/node_modules/minipass/LICENSE +15 -0
- package/node_modules/minipass/README.md +825 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts +549 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/commonjs/index.js +1028 -0
- package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/node_modules/minipass/dist/esm/index.d.ts +549 -0
- package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/esm/index.js +1018 -0
- package/node_modules/minipass/dist/esm/index.js.map +1 -0
- package/node_modules/minipass/dist/esm/package.json +3 -0
- package/node_modules/minipass/package.json +82 -0
- package/node_modules/on-exit-leak-free/.github/dependabot.yml +12 -0
- package/node_modules/on-exit-leak-free/.github/workflows/ci.yml +46 -0
- package/node_modules/on-exit-leak-free/LICENSE +21 -0
- package/node_modules/on-exit-leak-free/README.md +54 -0
- package/node_modules/on-exit-leak-free/index.js +108 -0
- package/node_modules/on-exit-leak-free/package.json +37 -0
- package/node_modules/on-exit-leak-free/test/base.test.js +30 -0
- package/node_modules/on-exit-leak-free/test/event-emitter-leak.test.js +23 -0
- package/node_modules/on-exit-leak-free/test/fixtures/beforeExit.js +33 -0
- package/node_modules/on-exit-leak-free/test/fixtures/close.js +21 -0
- package/node_modules/on-exit-leak-free/test/fixtures/gc-not-close.js +24 -0
- package/node_modules/on-exit-leak-free/test/fixtures/unregister.js +24 -0
- package/node_modules/package-json-from-dist/LICENSE.md +63 -0
- package/node_modules/package-json-from-dist/README.md +110 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts +89 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.js +134 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.js.map +1 -0
- package/node_modules/package-json-from-dist/dist/commonjs/package.json +3 -0
- package/node_modules/package-json-from-dist/dist/esm/index.d.ts +89 -0
- package/node_modules/package-json-from-dist/dist/esm/index.d.ts.map +1 -0
- package/node_modules/package-json-from-dist/dist/esm/index.js +129 -0
- package/node_modules/package-json-from-dist/dist/esm/index.js.map +1 -0
- package/node_modules/package-json-from-dist/dist/esm/package.json +3 -0
- package/node_modules/package-json-from-dist/package.json +68 -0
- package/node_modules/path-key/index.d.ts +40 -0
- package/node_modules/path-key/index.js +16 -0
- package/node_modules/path-key/license +9 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-key/readme.md +61 -0
- package/node_modules/path-scurry/LICENSE.md +55 -0
- package/node_modules/path-scurry/README.md +636 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts +1115 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
- package/node_modules/path-scurry/dist/commonjs/index.js.map +1 -0
- package/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts +1115 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts.map +1 -0
- package/node_modules/path-scurry/dist/esm/index.js +1983 -0
- package/node_modules/path-scurry/dist/esm/index.js.map +1 -0
- package/node_modules/path-scurry/dist/esm/package.json +3 -0
- package/node_modules/path-scurry/node_modules/lru-cache/LICENSE.md +55 -0
- package/node_modules/path-scurry/node_modules/lru-cache/README.md +383 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts +1323 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js +1589 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts +1323 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js +1585 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json +3 -0
- package/node_modules/path-scurry/node_modules/lru-cache/package.json +101 -0
- package/node_modules/path-scurry/package.json +88 -0
- package/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/picomatch/README.md +708 -0
- package/node_modules/picomatch/index.js +3 -0
- package/node_modules/picomatch/lib/constants.js +179 -0
- package/node_modules/picomatch/lib/parse.js +1091 -0
- package/node_modules/picomatch/lib/picomatch.js +342 -0
- package/node_modules/picomatch/lib/scan.js +391 -0
- package/node_modules/picomatch/lib/utils.js +64 -0
- package/node_modules/picomatch/package.json +81 -0
- package/node_modules/pino/.nojekyll +0 -0
- package/node_modules/pino/.prettierignore +1 -0
- package/node_modules/pino/CNAME +1 -0
- package/node_modules/pino/CONTRIBUTING.md +30 -0
- package/node_modules/pino/LICENSE +21 -0
- package/node_modules/pino/README.md +177 -0
- package/node_modules/pino/SECURITY.md +87 -0
- package/node_modules/pino/benchmarks/basic.bench.js +95 -0
- package/node_modules/pino/benchmarks/child-child.bench.js +52 -0
- package/node_modules/pino/benchmarks/child-creation.bench.js +73 -0
- package/node_modules/pino/benchmarks/child.bench.js +62 -0
- package/node_modules/pino/benchmarks/deep-object.bench.js +88 -0
- package/node_modules/pino/benchmarks/formatters.bench.js +50 -0
- package/node_modules/pino/benchmarks/internal/custom-levels.js +67 -0
- package/node_modules/pino/benchmarks/internal/just-pino-heavy.bench.js +76 -0
- package/node_modules/pino/benchmarks/internal/just-pino.bench.js +182 -0
- package/node_modules/pino/benchmarks/internal/parent-vs-child.bench.js +75 -0
- package/node_modules/pino/benchmarks/internal/redact.bench.js +86 -0
- package/node_modules/pino/benchmarks/long-string.bench.js +81 -0
- package/node_modules/pino/benchmarks/multi-arg.bench.js +193 -0
- package/node_modules/pino/benchmarks/multistream.js +98 -0
- package/node_modules/pino/benchmarks/object.bench.js +82 -0
- package/node_modules/pino/benchmarks/utils/generate-benchmark-doc.js +36 -0
- package/node_modules/pino/benchmarks/utils/runbench.js +138 -0
- package/node_modules/pino/benchmarks/utils/wrap-log-level.js +55 -0
- package/node_modules/pino/bin.js +6 -0
- package/node_modules/pino/browser.js +547 -0
- package/node_modules/pino/build/sync-version.js +25 -0
- package/node_modules/pino/docs/api.md +1593 -0
- package/node_modules/pino/docs/asynchronous.md +40 -0
- package/node_modules/pino/docs/benchmarks.md +55 -0
- package/node_modules/pino/docs/browser.md +278 -0
- package/node_modules/pino/docs/bundling.md +40 -0
- package/node_modules/pino/docs/child-loggers.md +95 -0
- package/node_modules/pino/docs/diagnostics.md +16 -0
- package/node_modules/pino/docs/ecosystem.md +86 -0
- package/node_modules/pino/docs/help.md +345 -0
- package/node_modules/pino/docs/lts.md +64 -0
- package/node_modules/pino/docs/pretty.md +35 -0
- package/node_modules/pino/docs/redaction.md +135 -0
- package/node_modules/pino/docs/transports.md +1376 -0
- package/node_modules/pino/docs/web.md +309 -0
- package/node_modules/pino/eslint.config.js +28 -0
- package/node_modules/pino/examples/basic.js +43 -0
- package/node_modules/pino/examples/transport.js +68 -0
- package/node_modules/pino/favicon.ico +0 -0
- package/node_modules/pino/file.js +12 -0
- package/node_modules/pino/inc-version.sh +42 -0
- package/node_modules/pino/index.html +55 -0
- package/node_modules/pino/lib/caller.js +30 -0
- package/node_modules/pino/lib/constants.js +28 -0
- package/node_modules/pino/lib/deprecations.js +8 -0
- package/node_modules/pino/lib/levels.js +241 -0
- package/node_modules/pino/lib/meta.js +3 -0
- package/node_modules/pino/lib/multistream.js +203 -0
- package/node_modules/pino/lib/proto.js +256 -0
- package/node_modules/pino/lib/redaction.js +114 -0
- package/node_modules/pino/lib/symbols.js +74 -0
- package/node_modules/pino/lib/time.js +39 -0
- package/node_modules/pino/lib/tools.js +427 -0
- package/node_modules/pino/lib/transport-stream.js +56 -0
- package/node_modules/pino/lib/transport.js +289 -0
- package/node_modules/pino/lib/worker.js +194 -0
- package/node_modules/pino/package.json +120 -0
- package/node_modules/pino/pino.d.ts +908 -0
- package/node_modules/pino/pino.js +234 -0
- package/node_modules/pino/test/basic.test.js +886 -0
- package/node_modules/pino/test/broken-pipe.test.js +59 -0
- package/node_modules/pino/test/browser-child.test.js +132 -0
- package/node_modules/pino/test/browser-disabled.test.js +87 -0
- package/node_modules/pino/test/browser-early-console-freeze.test.js +12 -0
- package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
- package/node_modules/pino/test/browser-levels.test.js +241 -0
- package/node_modules/pino/test/browser-serializers.test.js +352 -0
- package/node_modules/pino/test/browser-timestamp.test.js +88 -0
- package/node_modules/pino/test/browser-transmit.test.js +417 -0
- package/node_modules/pino/test/browser.test.js +698 -0
- package/node_modules/pino/test/complex-objects.test.js +36 -0
- package/node_modules/pino/test/crlf.test.js +34 -0
- package/node_modules/pino/test/custom-levels.test.js +267 -0
- package/node_modules/pino/test/diagnostics.test.js +107 -0
- package/node_modules/pino/test/error-key.test.js +37 -0
- package/node_modules/pino/test/error.test.js +403 -0
- package/node_modules/pino/test/escaping.test.js +93 -0
- package/node_modules/pino/test/esm/esm.mjs +14 -0
- package/node_modules/pino/test/esm/index.test.js +21 -0
- package/node_modules/pino/test/esm/named-exports.mjs +29 -0
- package/node_modules/pino/test/exit.test.js +79 -0
- package/node_modules/pino/test/fixtures/broken-pipe/basic.js +9 -0
- package/node_modules/pino/test/fixtures/broken-pipe/destination.js +10 -0
- package/node_modules/pino/test/fixtures/broken-pipe/syncfalse.js +12 -0
- package/node_modules/pino/test/fixtures/console-transport.js +13 -0
- package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
- package/node_modules/pino/test/fixtures/default-exit.js +8 -0
- package/node_modules/pino/test/fixtures/destination-exit.js +8 -0
- package/node_modules/pino/test/fixtures/eval/index.js +13 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/14-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/2-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file1.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file10.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file11.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file12.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file13.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file14.js +11 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file2.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file3.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file4.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file5.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file6.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file7.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file8.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file9.js +5 -0
- package/node_modules/pino/test/fixtures/noop-transport.js +10 -0
- package/node_modules/pino/test/fixtures/pretty/null-prototype.js +8 -0
- package/node_modules/pino/test/fixtures/stdout-hack-protection.js +11 -0
- package/node_modules/pino/test/fixtures/syncfalse-child.js +6 -0
- package/node_modules/pino/test/fixtures/syncfalse-exit.js +9 -0
- package/node_modules/pino/test/fixtures/syncfalse-flush-exit.js +10 -0
- package/node_modules/pino/test/fixtures/syncfalse.js +6 -0
- package/node_modules/pino/test/fixtures/syntax-error-esm.mjs +2 -0
- package/node_modules/pino/test/fixtures/to-file-transport-with-transform.js +20 -0
- package/node_modules/pino/test/fixtures/to-file-transport.js +13 -0
- package/node_modules/pino/test/fixtures/to-file-transport.mjs +8 -0
- package/node_modules/pino/test/fixtures/transport/index.js +12 -0
- package/node_modules/pino/test/fixtures/transport/package.json +5 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately-with-async-dest.js +16 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately.js +11 -0
- package/node_modules/pino/test/fixtures/transport-exit-on-ready.js +12 -0
- package/node_modules/pino/test/fixtures/transport-invalid-node-options.js +26 -0
- package/node_modules/pino/test/fixtures/transport-main.js +9 -0
- package/node_modules/pino/test/fixtures/transport-many-lines.js +29 -0
- package/node_modules/pino/test/fixtures/transport-preload-main.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-preload.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-string-stdout.js +9 -0
- package/node_modules/pino/test/fixtures/transport-transform.js +21 -0
- package/node_modules/pino/test/fixtures/transport-uses-pino-config.js +33 -0
- package/node_modules/pino/test/fixtures/transport-with-on-exit.js +12 -0
- package/node_modules/pino/test/fixtures/transport-worker-data.js +19 -0
- package/node_modules/pino/test/fixtures/transport-worker-name.js +24 -0
- package/node_modules/pino/test/fixtures/transport-worker.js +15 -0
- package/node_modules/pino/test/fixtures/transport-wrong-export-type.js +3 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-native.mts +15 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +18 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transpile.cjs +36 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +15 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately.ts +10 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-on-ready.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transport-main.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-string-stdout.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-worker.ts +14 -0
- package/node_modules/pino/test/formatters.test.js +364 -0
- package/node_modules/pino/test/helper.d.ts +4 -0
- package/node_modules/pino/test/helper.js +155 -0
- package/node_modules/pino/test/hooks.test.js +114 -0
- package/node_modules/pino/test/http.test.js +214 -0
- package/node_modules/pino/test/internals/version.test.js +17 -0
- package/node_modules/pino/test/is-level-enabled.test.js +179 -0
- package/node_modules/pino/test/jest/basic.spec.js +10 -0
- package/node_modules/pino/test/levels.test.js +810 -0
- package/node_modules/pino/test/metadata.test.js +120 -0
- package/node_modules/pino/test/mixin-merge-strategy.test.js +57 -0
- package/node_modules/pino/test/mixin.test.js +241 -0
- package/node_modules/pino/test/multistream.test.js +729 -0
- package/node_modules/pino/test/redact.test.js +893 -0
- package/node_modules/pino/test/serializers.test.js +257 -0
- package/node_modules/pino/test/stdout-protection.test.js +41 -0
- package/node_modules/pino/test/syncfalse.test.js +186 -0
- package/node_modules/pino/test/timestamp-nano.test.js +37 -0
- package/node_modules/pino/test/timestamp.test.js +124 -0
- package/node_modules/pino/test/transport/big.test.js +42 -0
- package/node_modules/pino/test/transport/bundlers-support.test.js +99 -0
- package/node_modules/pino/test/transport/caller.test.js +24 -0
- package/node_modules/pino/test/transport/core.test.js +733 -0
- package/node_modules/pino/test/transport/core.transpiled.test.ts +114 -0
- package/node_modules/pino/test/transport/crash.test.js +36 -0
- package/node_modules/pino/test/transport/module-link.test.js +241 -0
- package/node_modules/pino/test/transport/native-type-stripping.test.mjs +151 -0
- package/node_modules/pino/test/transport/node-options.test.js +116 -0
- package/node_modules/pino/test/transport/pipeline.test.js +137 -0
- package/node_modules/pino/test/transport/preload.test.js +54 -0
- package/node_modules/pino/test/transport/repl.test.js +15 -0
- package/node_modules/pino/test/transport/sync-false.test.js +67 -0
- package/node_modules/pino/test/transport/sync-true.test.js +57 -0
- package/node_modules/pino/test/transport/targets.test.js +48 -0
- package/node_modules/pino/test/transport/uses-pino-config.test.js +166 -0
- package/node_modules/pino/test/transport-stream.test.js +40 -0
- package/node_modules/pino/test/types/pino-import.test-d.cts +30 -0
- package/node_modules/pino/test/types/pino-multistream.test-d.ts +28 -0
- package/node_modules/pino/test/types/pino-top-export.test-d.ts +34 -0
- package/node_modules/pino/test/types/pino-transport.test-d.ts +156 -0
- package/node_modules/pino/test/types/pino-type-only.test-d.ts +75 -0
- package/node_modules/pino/test/types/pino.test-d.ts +683 -0
- package/node_modules/pino/test/types/pino.ts +91 -0
- package/node_modules/pino/tsconfig.json +14 -0
- package/node_modules/pino-abstract-transport/.github/dependabot.yml +13 -0
- package/node_modules/pino-abstract-transport/.github/workflows/ci.yml +80 -0
- package/node_modules/pino-abstract-transport/.husky/pre-commit +4 -0
- package/node_modules/pino-abstract-transport/LICENSE +21 -0
- package/node_modules/pino-abstract-transport/README.md +171 -0
- package/node_modules/pino-abstract-transport/index.d.ts +122 -0
- package/node_modules/pino-abstract-transport/index.js +128 -0
- package/node_modules/pino-abstract-transport/package.json +41 -0
- package/node_modules/pino-abstract-transport/test/base.test.js +473 -0
- package/node_modules/pino-abstract-transport/test/fixtures/transport-async-iteration.js +22 -0
- package/node_modules/pino-abstract-transport/test/fixtures/transport-on-data.js +22 -0
- package/node_modules/pino-abstract-transport/test/fixtures/transport-transform.js +24 -0
- package/node_modules/pino-abstract-transport/test/fixtures/worker-pipeline.js +15 -0
- package/node_modules/pino-abstract-transport/test/match.js +24 -0
- package/node_modules/pino-abstract-transport/test/types/index.test-d.ts +31 -0
- package/node_modules/pino-abstract-transport/test/worker.test.js +372 -0
- package/node_modules/pino-std-serializers/.editorconfig +13 -0
- package/node_modules/pino-std-serializers/.github/dependabot.yml +13 -0
- package/node_modules/pino-std-serializers/.github/workflows/ci.yml +81 -0
- package/node_modules/pino-std-serializers/LICENSE +7 -0
- package/node_modules/pino-std-serializers/Readme.md +182 -0
- package/node_modules/pino-std-serializers/eslint.config.js +7 -0
- package/node_modules/pino-std-serializers/index.d.ts +145 -0
- package/node_modules/pino-std-serializers/index.js +36 -0
- package/node_modules/pino-std-serializers/lib/err-helpers.js +118 -0
- package/node_modules/pino-std-serializers/lib/err-proto.js +48 -0
- package/node_modules/pino-std-serializers/lib/err-with-cause.js +48 -0
- package/node_modules/pino-std-serializers/lib/err.js +45 -0
- package/node_modules/pino-std-serializers/lib/req.js +100 -0
- package/node_modules/pino-std-serializers/lib/res.js +47 -0
- package/node_modules/pino-std-serializers/package.json +42 -0
- package/node_modules/pino-std-serializers/test/err-with-cause.test.js +187 -0
- package/node_modules/pino-std-serializers/test/err.test.js +200 -0
- package/node_modules/pino-std-serializers/test/req.test.js +477 -0
- package/node_modules/pino-std-serializers/test/res.test.js +120 -0
- package/node_modules/pino-std-serializers/test/types/index.test-d.ts +71 -0
- package/node_modules/pino-std-serializers/tsconfig.json +13 -0
- package/node_modules/process-warning/.gitattributes +2 -0
- package/node_modules/process-warning/.github/dependabot.yml +13 -0
- package/node_modules/process-warning/.github/workflows/ci.yml +22 -0
- package/node_modules/process-warning/LICENSE +21 -0
- package/node_modules/process-warning/README.md +118 -0
- package/node_modules/process-warning/benchmarks/warn.js +25 -0
- package/node_modules/process-warning/eslint.config.js +6 -0
- package/node_modules/process-warning/examples/example.js +11 -0
- package/node_modules/process-warning/index.js +124 -0
- package/node_modules/process-warning/package.json +73 -0
- package/node_modules/process-warning/test/emit-interpolated-string.test.js +34 -0
- package/node_modules/process-warning/test/emit-once-only.test.js +33 -0
- package/node_modules/process-warning/test/emit-reset.test.js +40 -0
- package/node_modules/process-warning/test/emit-set.test.js +35 -0
- package/node_modules/process-warning/test/emit-unlimited.test.js +42 -0
- package/node_modules/process-warning/test/index.test.js +99 -0
- package/node_modules/process-warning/test/issue-88.test.js +38 -0
- package/node_modules/process-warning/test/jest.test.js +24 -0
- package/node_modules/process-warning/test/no-warnings.test.js +80 -0
- package/node_modules/process-warning/test/promise.js +10 -0
- package/node_modules/process-warning/types/index.d.ts +37 -0
- package/node_modules/process-warning/types/index.test-d.ts +36 -0
- package/node_modules/queue-microtask/LICENSE +20 -0
- package/node_modules/queue-microtask/README.md +90 -0
- package/node_modules/queue-microtask/index.d.ts +2 -0
- package/node_modules/queue-microtask/index.js +9 -0
- package/node_modules/queue-microtask/package.json +55 -0
- package/node_modules/quick-format-unescaped/.github/workflows/ci.yml +21 -0
- package/node_modules/quick-format-unescaped/LICENSE +21 -0
- package/node_modules/quick-format-unescaped/benchmark.js +24 -0
- package/node_modules/quick-format-unescaped/index.js +109 -0
- package/node_modules/quick-format-unescaped/package.json +29 -0
- package/node_modules/quick-format-unescaped/readme.md +66 -0
- package/node_modules/quick-format-unescaped/test/index.js +136 -0
- package/node_modules/readdirp/LICENSE +21 -0
- package/node_modules/readdirp/README.md +120 -0
- package/node_modules/readdirp/index.d.ts +108 -0
- package/node_modules/readdirp/index.js +272 -0
- package/node_modules/readdirp/package.json +66 -0
- package/node_modules/real-require/LICENSE.md +21 -0
- package/node_modules/real-require/README.md +51 -0
- package/node_modules/real-require/package.json +49 -0
- package/node_modules/real-require/src/index.js +14 -0
- package/node_modules/require-from-string/index.js +34 -0
- package/node_modules/require-from-string/license +21 -0
- package/node_modules/require-from-string/package.json +28 -0
- package/node_modules/require-from-string/readme.md +56 -0
- package/node_modules/ret/LICENSE +21 -0
- package/node_modules/ret/README.md +539 -0
- package/node_modules/ret/dist/index.d.ts +7 -0
- package/node_modules/ret/dist/index.js +26 -0
- package/node_modules/ret/dist/index.js.map +1 -0
- package/node_modules/ret/dist/reconstruct.d.ts +2 -0
- package/node_modules/ret/dist/reconstruct.js +77 -0
- package/node_modules/ret/dist/reconstruct.js.map +1 -0
- package/node_modules/ret/dist/sets-lookup.d.ts +5 -0
- package/node_modules/ret/dist/sets-lookup.js +51 -0
- package/node_modules/ret/dist/sets-lookup.js.map +1 -0
- package/node_modules/ret/dist/sets.d.ts +9 -0
- package/node_modules/ret/dist/sets.js +43 -0
- package/node_modules/ret/dist/sets.js.map +1 -0
- package/node_modules/ret/dist/tokenizer.d.ts +8 -0
- package/node_modules/ret/dist/tokenizer.js +361 -0
- package/node_modules/ret/dist/tokenizer.js.map +1 -0
- package/node_modules/ret/dist/types/index.d.ts +3 -0
- package/node_modules/ret/dist/types/index.js +16 -0
- package/node_modules/ret/dist/types/index.js.map +1 -0
- package/node_modules/ret/dist/types/set-lookup.d.ts +8 -0
- package/node_modules/ret/dist/types/set-lookup.js +3 -0
- package/node_modules/ret/dist/types/set-lookup.js.map +1 -0
- package/node_modules/ret/dist/types/tokens.d.ts +41 -0
- package/node_modules/ret/dist/types/tokens.js +3 -0
- package/node_modules/ret/dist/types/tokens.js.map +1 -0
- package/node_modules/ret/dist/types/types.d.ts +10 -0
- package/node_modules/ret/dist/types/types.js +15 -0
- package/node_modules/ret/dist/types/types.js.map +1 -0
- package/node_modules/ret/dist/util.d.ts +18 -0
- package/node_modules/ret/dist/util.js +82 -0
- package/node_modules/ret/dist/util.js.map +1 -0
- package/node_modules/ret/dist/write-set-tokens.d.ts +14 -0
- package/node_modules/ret/dist/write-set-tokens.js +108 -0
- package/node_modules/ret/dist/write-set-tokens.js.map +1 -0
- package/node_modules/ret/package.json +42 -0
- package/node_modules/reusify/.github/dependabot.yml +7 -0
- package/node_modules/reusify/.github/workflows/ci.yml +96 -0
- package/node_modules/reusify/LICENSE +22 -0
- package/node_modules/reusify/README.md +139 -0
- package/node_modules/reusify/SECURITY.md +15 -0
- package/node_modules/reusify/benchmarks/createNoCodeFunction.js +30 -0
- package/node_modules/reusify/benchmarks/fib.js +13 -0
- package/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +38 -0
- package/node_modules/reusify/eslint.config.js +14 -0
- package/node_modules/reusify/package.json +50 -0
- package/node_modules/reusify/reusify.d.ts +14 -0
- package/node_modules/reusify/reusify.js +33 -0
- package/node_modules/reusify/test.js +66 -0
- package/node_modules/reusify/tsconfig.json +11 -0
- package/node_modules/rfdc/.github/workflows/ci.yml +21 -0
- package/node_modules/rfdc/LICENSE +15 -0
- package/node_modules/rfdc/default.js +3 -0
- package/node_modules/rfdc/index.d.ts +13 -0
- package/node_modules/rfdc/index.js +198 -0
- package/node_modules/rfdc/index.test-d.ts +13 -0
- package/node_modules/rfdc/package.json +73 -0
- package/node_modules/rfdc/readme.md +181 -0
- package/node_modules/rfdc/test/index.js +306 -0
- package/node_modules/run-parallel/LICENSE +20 -0
- package/node_modules/run-parallel/README.md +85 -0
- package/node_modules/run-parallel/index.js +51 -0
- package/node_modules/run-parallel/package.json +58 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/safe-buffer/package.json +51 -0
- package/node_modules/safe-regex2/.gitattributes +2 -0
- package/node_modules/safe-regex2/.github/dependabot.yml +13 -0
- package/node_modules/safe-regex2/.github/stale.yml +21 -0
- package/node_modules/safe-regex2/.github/workflows/ci.yml +25 -0
- package/node_modules/safe-regex2/LICENSE +18 -0
- package/node_modules/safe-regex2/README.md +59 -0
- package/node_modules/safe-regex2/eslint.config.js +6 -0
- package/node_modules/safe-regex2/example/safe.js +5 -0
- package/node_modules/safe-regex2/index.js +54 -0
- package/node_modules/safe-regex2/package.json +77 -0
- package/node_modules/safe-regex2/test/regex.js +51 -0
- package/node_modules/safe-regex2/types/index.d.ts +9 -0
- package/node_modules/safe-regex2/types/index.test-d.ts +12 -0
- package/node_modules/safe-stable-stringify/LICENSE +21 -0
- package/node_modules/safe-stable-stringify/esm/package.json +4 -0
- package/node_modules/safe-stable-stringify/esm/wrapper.d.ts +4 -0
- package/node_modules/safe-stable-stringify/esm/wrapper.js +6 -0
- package/node_modules/safe-stable-stringify/index.d.ts +22 -0
- package/node_modules/safe-stable-stringify/index.js +625 -0
- package/node_modules/safe-stable-stringify/package.json +65 -0
- package/node_modules/safe-stable-stringify/readme.md +179 -0
- package/node_modules/secure-json-parse/.airtap.yml +7 -0
- package/node_modules/secure-json-parse/.gitattributes +2 -0
- package/node_modules/secure-json-parse/.github/dependabot.yml +13 -0
- package/node_modules/secure-json-parse/.github/stale.yml +21 -0
- package/node_modules/secure-json-parse/.github/workflows/ci.yml +149 -0
- package/node_modules/secure-json-parse/LICENSE +19 -0
- package/node_modules/secure-json-parse/README.md +132 -0
- package/node_modules/secure-json-parse/benchmarks/ignore.js +35 -0
- package/node_modules/secure-json-parse/benchmarks/no__proto__.js +40 -0
- package/node_modules/secure-json-parse/benchmarks/package.json +15 -0
- package/node_modules/secure-json-parse/benchmarks/remove.js +39 -0
- package/node_modules/secure-json-parse/benchmarks/throw.js +49 -0
- package/node_modules/secure-json-parse/benchmarks/valid.js +49 -0
- package/node_modules/secure-json-parse/eslint.config.js +6 -0
- package/node_modules/secure-json-parse/index.js +161 -0
- package/node_modules/secure-json-parse/package.json +74 -0
- package/node_modules/secure-json-parse/test/index.test.js +649 -0
- package/node_modules/secure-json-parse/types/index.d.ts +60 -0
- package/node_modules/secure-json-parse/types/index.test-d.ts +43 -0
- package/node_modules/set-cookie-parser/LICENSE +21 -0
- package/node_modules/set-cookie-parser/README.md +202 -0
- package/node_modules/set-cookie-parser/lib/set-cookie.js +242 -0
- package/node_modules/set-cookie-parser/package.json +45 -0
- package/node_modules/setprototypeof/LICENSE +13 -0
- package/node_modules/setprototypeof/README.md +31 -0
- package/node_modules/setprototypeof/index.d.ts +2 -0
- package/node_modules/setprototypeof/index.js +17 -0
- package/node_modules/setprototypeof/package.json +38 -0
- package/node_modules/setprototypeof/test/index.js +24 -0
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/license +9 -0
- package/node_modules/shebang-command/package.json +34 -0
- package/node_modules/shebang-command/readme.md +34 -0
- package/node_modules/shebang-regex/index.d.ts +22 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/license +9 -0
- package/node_modules/shebang-regex/package.json +35 -0
- package/node_modules/shebang-regex/readme.md +33 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +74 -0
- package/node_modules/signal-exit/dist/cjs/browser.d.ts +12 -0
- package/node_modules/signal-exit/dist/cjs/browser.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/browser.js +10 -0
- package/node_modules/signal-exit/dist/cjs/browser.js.map +1 -0
- package/node_modules/signal-exit/dist/cjs/index.d.ts +48 -0
- package/node_modules/signal-exit/dist/cjs/index.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/index.js +279 -0
- package/node_modules/signal-exit/dist/cjs/index.js.map +1 -0
- package/node_modules/signal-exit/dist/cjs/package.json +3 -0
- package/node_modules/signal-exit/dist/cjs/signals.d.ts +29 -0
- package/node_modules/signal-exit/dist/cjs/signals.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/signals.js +42 -0
- package/node_modules/signal-exit/dist/cjs/signals.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/browser.d.ts +12 -0
- package/node_modules/signal-exit/dist/mjs/browser.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/browser.js +4 -0
- package/node_modules/signal-exit/dist/mjs/browser.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/index.d.ts +48 -0
- package/node_modules/signal-exit/dist/mjs/index.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/index.js +275 -0
- package/node_modules/signal-exit/dist/mjs/index.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/package.json +3 -0
- package/node_modules/signal-exit/dist/mjs/signals.d.ts +29 -0
- package/node_modules/signal-exit/dist/mjs/signals.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/signals.js +39 -0
- package/node_modules/signal-exit/dist/mjs/signals.js.map +1 -0
- package/node_modules/signal-exit/package.json +106 -0
- package/node_modules/sonic-boom/.eslintignore +2 -0
- package/node_modules/sonic-boom/.taprc +3 -0
- package/node_modules/sonic-boom/LICENSE +21 -0
- package/node_modules/sonic-boom/README.md +153 -0
- package/node_modules/sonic-boom/bench.js +98 -0
- package/node_modules/sonic-boom/check.js +18 -0
- package/node_modules/sonic-boom/example.js +8 -0
- package/node_modules/sonic-boom/fixtures/firehose.js +22 -0
- package/node_modules/sonic-boom/index.js +733 -0
- package/node_modules/sonic-boom/package.json +52 -0
- package/node_modules/sonic-boom/test/destroy.test.js +49 -0
- package/node_modules/sonic-boom/test/end.test.js +98 -0
- package/node_modules/sonic-boom/test/flush-sync.test.js +140 -0
- package/node_modules/sonic-boom/test/flush.test.js +419 -0
- package/node_modules/sonic-boom/test/fsync.test.js +63 -0
- package/node_modules/sonic-boom/test/helper.js +42 -0
- package/node_modules/sonic-boom/test/minlength.test.js +35 -0
- package/node_modules/sonic-boom/test/mode.test.js +116 -0
- package/node_modules/sonic-boom/test/periodicflush.test.js +61 -0
- package/node_modules/sonic-boom/test/reopen.test.js +239 -0
- package/node_modules/sonic-boom/test/retry.test.js +414 -0
- package/node_modules/sonic-boom/test/sync.test.js +261 -0
- package/node_modules/sonic-boom/test/write.test.js +515 -0
- package/node_modules/sonic-boom/types/index.d.ts +63 -0
- package/node_modules/sonic-boom/types/tests/test.ts +4 -0
- package/node_modules/split2/LICENSE +13 -0
- package/node_modules/split2/README.md +85 -0
- package/node_modules/split2/bench.js +27 -0
- package/node_modules/split2/index.js +141 -0
- package/node_modules/split2/package.json +39 -0
- package/node_modules/split2/test.js +409 -0
- package/node_modules/statuses/HISTORY.md +87 -0
- package/node_modules/statuses/LICENSE +23 -0
- package/node_modules/statuses/README.md +139 -0
- package/node_modules/statuses/codes.json +65 -0
- package/node_modules/statuses/index.js +146 -0
- package/node_modules/statuses/package.json +49 -0
- package/node_modules/thread-stream/.github/dependabot.yml +13 -0
- package/node_modules/thread-stream/.github/workflows/ci.yml +74 -0
- package/node_modules/thread-stream/.husky/pre-commit +4 -0
- package/node_modules/thread-stream/CLAUDE.md +53 -0
- package/node_modules/thread-stream/LICENSE +21 -0
- package/node_modules/thread-stream/README.md +135 -0
- package/node_modules/thread-stream/bench.js +85 -0
- package/node_modules/thread-stream/eslint.config.js +10 -0
- package/node_modules/thread-stream/index.d.ts +92 -0
- package/node_modules/thread-stream/index.js +541 -0
- package/node_modules/thread-stream/lib/indexes.js +9 -0
- package/node_modules/thread-stream/lib/wait.js +68 -0
- package/node_modules/thread-stream/lib/worker.js +179 -0
- package/node_modules/thread-stream/package.json +52 -0
- package/node_modules/thread-stream/test/base.test.js +259 -0
- package/node_modules/thread-stream/test/bench.test.js +38 -0
- package/node_modules/thread-stream/test/bundlers.test.js +59 -0
- package/node_modules/thread-stream/test/close-on-gc.js +37 -0
- package/node_modules/thread-stream/test/commonjs-fallback.test.js +75 -0
- package/node_modules/thread-stream/test/context.test.js +21 -0
- package/node_modules/thread-stream/test/create-and-exit.js +16 -0
- package/node_modules/thread-stream/test/custom-worker.js +9 -0
- package/node_modules/thread-stream/test/dir with spaces/test-package.zip +0 -0
- package/node_modules/thread-stream/test/emit-event.js +22 -0
- package/node_modules/thread-stream/test/end.test.js +56 -0
- package/node_modules/thread-stream/test/error.js +14 -0
- package/node_modules/thread-stream/test/esm.test.mjs +46 -0
- package/node_modules/thread-stream/test/event.test.js +24 -0
- package/node_modules/thread-stream/test/exit.js +14 -0
- package/node_modules/thread-stream/test/get-context.js +22 -0
- package/node_modules/thread-stream/test/helper.d.ts +1 -0
- package/node_modules/thread-stream/test/helper.js +26 -0
- package/node_modules/thread-stream/test/indexes.test.js +11 -0
- package/node_modules/thread-stream/test/multibyte-chars.test.mjs +75 -0
- package/node_modules/thread-stream/test/on-message.js +18 -0
- package/node_modules/thread-stream/test/pkg/index.js +37 -0
- package/node_modules/thread-stream/test/pkg/pkg.config.json +14 -0
- package/node_modules/thread-stream/test/pkg/pkg.test.js +45 -0
- package/node_modules/thread-stream/test/port.js +16 -0
- package/node_modules/thread-stream/test/post-message.test.js +23 -0
- package/node_modules/thread-stream/test/string-limit-2.test.js +35 -0
- package/node_modules/thread-stream/test/string-limit.test.js +37 -0
- package/node_modules/thread-stream/test/syntax-error.mjs +2 -0
- package/node_modules/thread-stream/test/thread-management.test.js +138 -0
- package/node_modules/thread-stream/test/to-file-on-destroy.js +23 -0
- package/node_modules/thread-stream/test/to-file-on-final.js +24 -0
- package/node_modules/thread-stream/test/to-file.js +12 -0
- package/node_modules/thread-stream/test/to-file.mjs +8 -0
- package/node_modules/thread-stream/test/to-next.js +9 -0
- package/node_modules/thread-stream/test/transpiled.test.js +29 -0
- package/node_modules/thread-stream/test/ts/to-file.ts +10 -0
- package/node_modules/thread-stream/test/ts/transpile.sh +19 -0
- package/node_modules/thread-stream/test/ts-commonjs-default-export.zip +0 -0
- package/node_modules/thread-stream/test/ts-native.test.mjs +35 -0
- package/node_modules/thread-stream/test/ts-node-fallback.test.js +35 -0
- package/node_modules/thread-stream/test/uncaughtException.js +21 -0
- package/node_modules/thread-stream/test/unhandledRejection.js +21 -0
- package/node_modules/thread-stream/test/yarnrc.yml +7 -0
- package/node_modules/thread-stream/tsconfig.json +8 -0
- package/node_modules/to-regex-range/LICENSE +21 -0
- package/node_modules/to-regex-range/README.md +305 -0
- package/node_modules/to-regex-range/index.js +288 -0
- package/node_modules/to-regex-range/package.json +88 -0
- package/node_modules/toad-cache/LICENSE +21 -0
- package/node_modules/toad-cache/README.md +265 -0
- package/node_modules/toad-cache/dist/toad-cache.cjs +878 -0
- package/node_modules/toad-cache/dist/toad-cache.mjs +852 -0
- package/node_modules/toad-cache/package.json +82 -0
- package/node_modules/toad-cache/toad-cache.d.cts +138 -0
- package/node_modules/toad-cache/toad-cache.d.ts +128 -0
- package/node_modules/toidentifier/HISTORY.md +9 -0
- package/node_modules/toidentifier/LICENSE +21 -0
- package/node_modules/toidentifier/README.md +61 -0
- package/node_modules/toidentifier/index.js +32 -0
- package/node_modules/toidentifier/package.json +38 -0
- package/node_modules/which/LICENSE +15 -0
- package/node_modules/which/README.md +54 -0
- package/node_modules/which/bin/node-which +52 -0
- package/node_modules/which/package.json +43 -0
- package/node_modules/which/which.js +125 -0
- package/package.json +45 -0
|
@@ -0,0 +1,3793 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* eslint n/no-deprecated-api: "off" */
|
|
4
|
+
|
|
5
|
+
const path = require('node:path')
|
|
6
|
+
const fs = require('node:fs')
|
|
7
|
+
const url = require('node:url')
|
|
8
|
+
const http = require('node:http')
|
|
9
|
+
const { test } = require('node:test')
|
|
10
|
+
const Fastify = require('fastify')
|
|
11
|
+
const compress = require('@fastify/compress')
|
|
12
|
+
const concat = require('concat-stream')
|
|
13
|
+
const pino = require('pino')
|
|
14
|
+
const proxyquire = require('proxyquire')
|
|
15
|
+
|
|
16
|
+
const fastifyStatic = require('../')
|
|
17
|
+
|
|
18
|
+
const indexContent = fs
|
|
19
|
+
.readFileSync('./test/static/index.html')
|
|
20
|
+
.toString('utf8')
|
|
21
|
+
const index2Content = fs
|
|
22
|
+
.readFileSync('./test/static2/index.html')
|
|
23
|
+
.toString('utf8')
|
|
24
|
+
const foobarContent = fs
|
|
25
|
+
.readFileSync('./test/static/foobar.html')
|
|
26
|
+
.toString('utf8')
|
|
27
|
+
const deepContent = fs
|
|
28
|
+
.readFileSync('./test/static/deep/path/for/test/purpose/foo.html')
|
|
29
|
+
.toString('utf8')
|
|
30
|
+
const innerIndex = fs
|
|
31
|
+
.readFileSync('./test/static/deep/path/for/test/index.html')
|
|
32
|
+
.toString('utf8')
|
|
33
|
+
const allThreeBr = fs.readFileSync(
|
|
34
|
+
'./test/static-pre-compressed/all-three.html.br'
|
|
35
|
+
)
|
|
36
|
+
const allThreeGzip = fs.readFileSync(
|
|
37
|
+
'./test/static-pre-compressed/all-three.html.gz'
|
|
38
|
+
)
|
|
39
|
+
const gzipOnly = fs.readFileSync(
|
|
40
|
+
'./test/static-pre-compressed/gzip-only.html.gz'
|
|
41
|
+
)
|
|
42
|
+
const indexBr = fs.readFileSync(
|
|
43
|
+
'./test/static-pre-compressed/index.html.br'
|
|
44
|
+
)
|
|
45
|
+
const dirIndexBr = fs.readFileSync(
|
|
46
|
+
'./test/static-pre-compressed/dir/index.html.br'
|
|
47
|
+
)
|
|
48
|
+
const dirIndexGz = fs.readFileSync(
|
|
49
|
+
'./test/static-pre-compressed/dir-gz/index.html.gz'
|
|
50
|
+
)
|
|
51
|
+
const uncompressedStatic = fs
|
|
52
|
+
.readFileSync('./test/static-pre-compressed/uncompressed.html')
|
|
53
|
+
.toString('utf8')
|
|
54
|
+
const fooContent = fs.readFileSync('./test/static/foo.html').toString('utf8')
|
|
55
|
+
const barContent = fs.readFileSync('./test/static2/bar.html').toString('utf8')
|
|
56
|
+
const jsonHiddenContent = fs.readFileSync('./test/static-hidden/.hidden/sample.json').toString('utf8')
|
|
57
|
+
|
|
58
|
+
const GENERIC_RESPONSE_CHECK_COUNT = 5
|
|
59
|
+
function genericResponseChecks (t, response) {
|
|
60
|
+
t.assert.ok(/text\/(html|css)/.test(response.headers.get?.('content-type') ?? response.headers['content-type']))
|
|
61
|
+
t.assert.ok(response.headers.get?.('etag') ?? response.headers.etag)
|
|
62
|
+
t.assert.ok(response.headers.get?.('last-modified') ?? response.headers['last-modified'])
|
|
63
|
+
t.assert.ok(response.headers.get?.('date') ?? response.headers.date)
|
|
64
|
+
t.assert.ok(response.headers.get?.('cache-control') ?? response.headers['cache-control'])
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const GENERIC_ERROR_RESPONSE_CHECK_COUNT = 2
|
|
68
|
+
function genericErrorResponseChecks (t, response) {
|
|
69
|
+
t.assert.deepStrictEqual(response.headers.get?.('content-type') ?? response.headers['content-type'], 'application/json; charset=utf-8')
|
|
70
|
+
t.assert.ok(response.headers.get?.('date') ?? response.headers.date)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (typeof Promise.withResolvers === 'undefined') {
|
|
74
|
+
Promise.withResolvers = function () {
|
|
75
|
+
let promiseResolve, promiseReject
|
|
76
|
+
const promise = new Promise((resolve, reject) => {
|
|
77
|
+
promiseResolve = resolve
|
|
78
|
+
promiseReject = reject
|
|
79
|
+
})
|
|
80
|
+
return { promise, resolve: promiseResolve, reject: promiseReject }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
test('register /static prefixAvoidTrailingSlash', async t => {
|
|
85
|
+
t.plan(11)
|
|
86
|
+
|
|
87
|
+
const pluginOptions = {
|
|
88
|
+
root: path.join(__dirname, '/static'),
|
|
89
|
+
prefix: '/static',
|
|
90
|
+
prefixAvoidTrailingSlash: true
|
|
91
|
+
}
|
|
92
|
+
const fastify = Fastify()
|
|
93
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
94
|
+
|
|
95
|
+
t.after(() => fastify.close())
|
|
96
|
+
|
|
97
|
+
await fastify.listen({ port: 0 })
|
|
98
|
+
|
|
99
|
+
fastify.server.unref()
|
|
100
|
+
|
|
101
|
+
await t.test('/static/index.html', async (t) => {
|
|
102
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
103
|
+
|
|
104
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
105
|
+
|
|
106
|
+
t.assert.ok(response.ok)
|
|
107
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
108
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
109
|
+
|
|
110
|
+
genericResponseChecks(t, response)
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
await t.test('/static/index.css', async (t) => {
|
|
114
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
115
|
+
|
|
116
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.css')
|
|
117
|
+
|
|
118
|
+
t.assert.ok(response.ok)
|
|
119
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
120
|
+
genericResponseChecks(t, response)
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
await t.test('/static/', async (t) => {
|
|
124
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
125
|
+
|
|
126
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/')
|
|
127
|
+
t.assert.ok(response.ok)
|
|
128
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
129
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
130
|
+
genericResponseChecks(t, response)
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
await t.test('/static', async (t) => {
|
|
134
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
135
|
+
|
|
136
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static')
|
|
137
|
+
t.assert.ok(response.ok)
|
|
138
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
139
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
140
|
+
genericResponseChecks(t, response)
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
await t.test('/static/deep/path/for/test/purpose/foo.html', async (t) => {
|
|
144
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
145
|
+
|
|
146
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/purpose/foo.html')
|
|
147
|
+
t.assert.ok(response.ok)
|
|
148
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
149
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
150
|
+
genericResponseChecks(t, response)
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
await t.test('/static/deep/path/for/test/', async (t) => {
|
|
154
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
155
|
+
|
|
156
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/')
|
|
157
|
+
t.assert.ok(response.ok)
|
|
158
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
159
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
160
|
+
genericResponseChecks(t, response)
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
await t.test('/static/this/path/for/test', async (t) => {
|
|
164
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
165
|
+
|
|
166
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/this/path/for/test')
|
|
167
|
+
t.assert.ok(!response.ok)
|
|
168
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
169
|
+
genericErrorResponseChecks(t, response)
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
await t.test('/static/this/path/doesnt/exist.html', async (t) => {
|
|
173
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
174
|
+
|
|
175
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/this/path/doesnt/exist.html')
|
|
176
|
+
t.assert.ok(!response.ok)
|
|
177
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
178
|
+
genericErrorResponseChecks(t, response)
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
await t.test('/static/../index.js', async (t) => {
|
|
182
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
183
|
+
|
|
184
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/../index.js')
|
|
185
|
+
t.assert.ok(!response.ok)
|
|
186
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
187
|
+
genericErrorResponseChecks(t, response)
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
await t.test('file not exposed outside of the plugin', async (t) => {
|
|
191
|
+
t.plan(2)
|
|
192
|
+
|
|
193
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foobar.html')
|
|
194
|
+
t.assert.ok(!response.ok)
|
|
195
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
await t.test('file retrieve with HEAD method', async t => {
|
|
199
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
200
|
+
|
|
201
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html', {
|
|
202
|
+
method: 'HEAD'
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
t.assert.ok(response.ok)
|
|
206
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
207
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
208
|
+
genericResponseChecks(t, response)
|
|
209
|
+
})
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
test('register /static', async (t) => {
|
|
213
|
+
t.plan(10)
|
|
214
|
+
|
|
215
|
+
const pluginOptions = {
|
|
216
|
+
root: path.join(__dirname, '/static'),
|
|
217
|
+
prefix: '/static'
|
|
218
|
+
}
|
|
219
|
+
const fastify = Fastify()
|
|
220
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
221
|
+
|
|
222
|
+
t.after(() => fastify.close())
|
|
223
|
+
|
|
224
|
+
await fastify.listen({ port: 0 })
|
|
225
|
+
|
|
226
|
+
fastify.server.unref()
|
|
227
|
+
|
|
228
|
+
await t.test('/static/index.html', async (t) => {
|
|
229
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
230
|
+
|
|
231
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
232
|
+
t.assert.ok(response.ok)
|
|
233
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
234
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
235
|
+
genericResponseChecks(t, response)
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
await t.test('/static/index.css', async (t) => {
|
|
239
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
240
|
+
|
|
241
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.css')
|
|
242
|
+
t.assert.ok(response.ok)
|
|
243
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
244
|
+
genericResponseChecks(t, response)
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
await t.test('/static/', async (t) => {
|
|
248
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
249
|
+
|
|
250
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/')
|
|
251
|
+
t.assert.ok(response.ok)
|
|
252
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
253
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
254
|
+
genericResponseChecks(t, response)
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
await t.test('/static', async (t) => {
|
|
258
|
+
t.plan(2)
|
|
259
|
+
|
|
260
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static')
|
|
261
|
+
t.assert.ok(!response.ok)
|
|
262
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
await t.test('/static/deep/path/for/test/purpose/foo.html', async (t) => {
|
|
266
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
267
|
+
|
|
268
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/purpose/foo.html')
|
|
269
|
+
t.assert.ok(response.ok)
|
|
270
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
271
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
272
|
+
genericResponseChecks(t, response)
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
await t.test('/static/deep/path/for/test/', async (t) => {
|
|
276
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
277
|
+
|
|
278
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/')
|
|
279
|
+
t.assert.ok(response.ok)
|
|
280
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
281
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
282
|
+
genericResponseChecks(t, response)
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
await t.test('/static/this/path/for/test', async (t) => {
|
|
286
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
287
|
+
|
|
288
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/this/path/for/test')
|
|
289
|
+
t.assert.ok(!response.ok)
|
|
290
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
291
|
+
genericErrorResponseChecks(t, response)
|
|
292
|
+
})
|
|
293
|
+
|
|
294
|
+
await t.test('/static/this/path/doesnt/exist.html', async (t) => {
|
|
295
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
296
|
+
|
|
297
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/this/path/doesnt/exist.html')
|
|
298
|
+
t.assert.ok(!response.ok)
|
|
299
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
300
|
+
genericErrorResponseChecks(t, response)
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
await t.test('/static/../index.js', async (t) => {
|
|
304
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
305
|
+
|
|
306
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/../index.js', {
|
|
307
|
+
redirect: 'error'
|
|
308
|
+
})
|
|
309
|
+
t.assert.ok(!response.ok)
|
|
310
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
311
|
+
genericErrorResponseChecks(t, response)
|
|
312
|
+
})
|
|
313
|
+
|
|
314
|
+
await t.test('file not exposed outside of the plugin', async (t) => {
|
|
315
|
+
t.plan(2)
|
|
316
|
+
|
|
317
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foobar.html')
|
|
318
|
+
t.assert.ok(!response.ok)
|
|
319
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
320
|
+
})
|
|
321
|
+
})
|
|
322
|
+
|
|
323
|
+
test('register /static/', async t => {
|
|
324
|
+
t.plan(11)
|
|
325
|
+
|
|
326
|
+
const pluginOptions = {
|
|
327
|
+
root: path.join(__dirname, '/static'),
|
|
328
|
+
prefix: '/static/'
|
|
329
|
+
}
|
|
330
|
+
const fastify = Fastify()
|
|
331
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
332
|
+
|
|
333
|
+
t.after(() => fastify.close())
|
|
334
|
+
|
|
335
|
+
await fastify.listen({ port: 0 })
|
|
336
|
+
|
|
337
|
+
fastify.server.unref()
|
|
338
|
+
|
|
339
|
+
await t.test('/static/index.html', async (t) => {
|
|
340
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
341
|
+
|
|
342
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
343
|
+
t.assert.ok(response.ok)
|
|
344
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
345
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
346
|
+
genericResponseChecks(t, response)
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
await t.test('/static/index.html', async t => {
|
|
350
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
351
|
+
|
|
352
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html', {
|
|
353
|
+
method: 'HEAD'
|
|
354
|
+
})
|
|
355
|
+
t.assert.ok(response.ok)
|
|
356
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
357
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
358
|
+
genericResponseChecks(t, response)
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
await t.test('/static/index.css', async (t) => {
|
|
362
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
363
|
+
|
|
364
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.css')
|
|
365
|
+
t.assert.ok(response.ok)
|
|
366
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
367
|
+
genericResponseChecks(t, response)
|
|
368
|
+
})
|
|
369
|
+
|
|
370
|
+
await t.test('/static/', async (t) => {
|
|
371
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
372
|
+
|
|
373
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/')
|
|
374
|
+
t.assert.ok(response.ok)
|
|
375
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
376
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
377
|
+
genericResponseChecks(t, response)
|
|
378
|
+
})
|
|
379
|
+
|
|
380
|
+
await t.test('/static', async (t) => {
|
|
381
|
+
t.plan(2)
|
|
382
|
+
|
|
383
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static')
|
|
384
|
+
t.assert.ok(!response.ok)
|
|
385
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
386
|
+
})
|
|
387
|
+
|
|
388
|
+
await t.test('/static/deep/path/for/test/purpose/foo.html', async (t) => {
|
|
389
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
390
|
+
|
|
391
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/purpose/foo.html')
|
|
392
|
+
t.assert.ok(response.ok)
|
|
393
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
394
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
395
|
+
genericResponseChecks(t, response)
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
await t.test('/static/deep/path/for/test/', async (t) => {
|
|
399
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
400
|
+
|
|
401
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/')
|
|
402
|
+
t.assert.ok(response.ok)
|
|
403
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
404
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
405
|
+
genericResponseChecks(t, response)
|
|
406
|
+
})
|
|
407
|
+
|
|
408
|
+
await t.test('/static/this/path/for/test', async (t) => {
|
|
409
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
410
|
+
|
|
411
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/this/path/for/test')
|
|
412
|
+
t.assert.ok(!response.ok)
|
|
413
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
414
|
+
genericErrorResponseChecks(t, response)
|
|
415
|
+
})
|
|
416
|
+
|
|
417
|
+
await t.test('/static/this/path/doesnt/exist.html', async (t) => {
|
|
418
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
419
|
+
|
|
420
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/this/path/doesnt/exist.html')
|
|
421
|
+
t.assert.ok(!response.ok)
|
|
422
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
423
|
+
genericErrorResponseChecks(t, response)
|
|
424
|
+
})
|
|
425
|
+
|
|
426
|
+
await t.test('/static/../index.js', async (t) => {
|
|
427
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
428
|
+
|
|
429
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/../index.js')
|
|
430
|
+
t.assert.ok(!response.ok)
|
|
431
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
432
|
+
genericErrorResponseChecks(t, response)
|
|
433
|
+
})
|
|
434
|
+
|
|
435
|
+
await t.test('304', async t => {
|
|
436
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
437
|
+
|
|
438
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
439
|
+
t.assert.ok(response.ok)
|
|
440
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
441
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
442
|
+
genericResponseChecks(t, response)
|
|
443
|
+
|
|
444
|
+
const response2 = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html', {
|
|
445
|
+
headers: {
|
|
446
|
+
'if-none-match': response.headers.get('etag')
|
|
447
|
+
},
|
|
448
|
+
cache: 'no-cache'
|
|
449
|
+
})
|
|
450
|
+
t.assert.ok(!response2.ok)
|
|
451
|
+
t.assert.deepStrictEqual(response2.status, 304)
|
|
452
|
+
})
|
|
453
|
+
})
|
|
454
|
+
|
|
455
|
+
test('register /static and /static2', async (t) => {
|
|
456
|
+
t.plan(4)
|
|
457
|
+
|
|
458
|
+
const pluginOptions = {
|
|
459
|
+
root: [path.join(__dirname, '/static'), path.join(__dirname, '/static2')],
|
|
460
|
+
prefix: '/static'
|
|
461
|
+
}
|
|
462
|
+
const fastify = Fastify()
|
|
463
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
464
|
+
|
|
465
|
+
fastify.get('/foo', (_req, rep) => {
|
|
466
|
+
rep.sendFile('foo.html')
|
|
467
|
+
})
|
|
468
|
+
|
|
469
|
+
fastify.get('/bar', (_req, rep) => {
|
|
470
|
+
rep.sendFile('bar.html')
|
|
471
|
+
})
|
|
472
|
+
|
|
473
|
+
t.after(() => fastify.close())
|
|
474
|
+
|
|
475
|
+
await fastify.listen({ port: 0 })
|
|
476
|
+
|
|
477
|
+
fastify.server.unref()
|
|
478
|
+
|
|
479
|
+
await t.test('/static/index.html', async (t) => {
|
|
480
|
+
t.plan(4 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
481
|
+
|
|
482
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
483
|
+
t.assert.ok(response.ok)
|
|
484
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
485
|
+
const responseText = await response.text()
|
|
486
|
+
t.assert.deepStrictEqual(responseText, indexContent)
|
|
487
|
+
t.assert.notDeepStrictEqual(responseText, index2Content)
|
|
488
|
+
genericResponseChecks(t, response)
|
|
489
|
+
})
|
|
490
|
+
|
|
491
|
+
await t.test('/static/bar.html', async (t) => {
|
|
492
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
493
|
+
|
|
494
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/bar.html')
|
|
495
|
+
t.assert.ok(response.ok)
|
|
496
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
497
|
+
t.assert.deepStrictEqual(await response.text(), barContent)
|
|
498
|
+
genericResponseChecks(t, response)
|
|
499
|
+
})
|
|
500
|
+
|
|
501
|
+
await t.test('sendFile foo.html', async (t) => {
|
|
502
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
503
|
+
|
|
504
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo')
|
|
505
|
+
t.assert.ok(response.ok)
|
|
506
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
507
|
+
t.assert.deepStrictEqual(await response.text(), fooContent)
|
|
508
|
+
genericResponseChecks(t, response)
|
|
509
|
+
})
|
|
510
|
+
|
|
511
|
+
await t.test('sendFile bar.html', async (t) => {
|
|
512
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
513
|
+
|
|
514
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/bar')
|
|
515
|
+
t.assert.ok(response.ok)
|
|
516
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
517
|
+
t.assert.deepStrictEqual(await response.text(), barContent)
|
|
518
|
+
genericResponseChecks(t, response)
|
|
519
|
+
})
|
|
520
|
+
})
|
|
521
|
+
|
|
522
|
+
test('register /static with constraints', async (t) => {
|
|
523
|
+
t.plan(2)
|
|
524
|
+
|
|
525
|
+
const pluginOptions = {
|
|
526
|
+
root: path.join(__dirname, '/static'),
|
|
527
|
+
prefix: '/static',
|
|
528
|
+
constraints: {
|
|
529
|
+
version: '1.2.0'
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
const fastify = Fastify()
|
|
533
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
534
|
+
|
|
535
|
+
t.after(() => fastify.close())
|
|
536
|
+
|
|
537
|
+
await fastify.listen({ port: 0 })
|
|
538
|
+
fastify.server.unref()
|
|
539
|
+
|
|
540
|
+
await t.test('example.com/static/index.html', async (t) => {
|
|
541
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
542
|
+
|
|
543
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html', {
|
|
544
|
+
headers: {
|
|
545
|
+
'accept-version': '1.x'
|
|
546
|
+
}
|
|
547
|
+
})
|
|
548
|
+
t.assert.ok(response.ok)
|
|
549
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
550
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
551
|
+
genericResponseChecks(t, response)
|
|
552
|
+
})
|
|
553
|
+
|
|
554
|
+
await t.test('not-example.com/static/index.html', async (t) => {
|
|
555
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
556
|
+
|
|
557
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html', {
|
|
558
|
+
headers: {
|
|
559
|
+
'accept-version': '2.x'
|
|
560
|
+
}
|
|
561
|
+
})
|
|
562
|
+
t.assert.ok(!response.ok)
|
|
563
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
564
|
+
genericErrorResponseChecks(t, response)
|
|
565
|
+
})
|
|
566
|
+
})
|
|
567
|
+
|
|
568
|
+
test('payload.path is set', async (t) => {
|
|
569
|
+
t.plan(2)
|
|
570
|
+
|
|
571
|
+
const pluginOptions = {
|
|
572
|
+
root: path.join(__dirname, '/static'),
|
|
573
|
+
prefix: '/static/'
|
|
574
|
+
}
|
|
575
|
+
const fastify = Fastify()
|
|
576
|
+
let gotFilename
|
|
577
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
578
|
+
fastify.addHook('onSend', function (_req, _reply, payload, next) {
|
|
579
|
+
gotFilename = payload.path
|
|
580
|
+
next()
|
|
581
|
+
})
|
|
582
|
+
|
|
583
|
+
t.after(() => fastify.close())
|
|
584
|
+
|
|
585
|
+
await fastify.listen({ port: 0 })
|
|
586
|
+
|
|
587
|
+
fastify.server.unref()
|
|
588
|
+
|
|
589
|
+
await t.test('/static/index.html', async (t) => {
|
|
590
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
591
|
+
|
|
592
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
593
|
+
t.assert.ok(response.ok)
|
|
594
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
595
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
596
|
+
t.assert.deepStrictEqual(typeof gotFilename, 'string')
|
|
597
|
+
t.assert.deepStrictEqual(gotFilename, path.join(pluginOptions.root, 'index.html'))
|
|
598
|
+
genericResponseChecks(t, response)
|
|
599
|
+
})
|
|
600
|
+
|
|
601
|
+
await t.test('/static/this/path/doesnt/exist.html', async (t) => {
|
|
602
|
+
t.plan(3 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
603
|
+
|
|
604
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/this/path/doesnt/exist.html')
|
|
605
|
+
t.assert.ok(!response.ok)
|
|
606
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
607
|
+
t.assert.deepStrictEqual(typeof gotFilename, 'undefined')
|
|
608
|
+
genericErrorResponseChecks(t, response)
|
|
609
|
+
})
|
|
610
|
+
})
|
|
611
|
+
|
|
612
|
+
test('error responses can be customized with fastify.setErrorHandler()', async t => {
|
|
613
|
+
t.plan(1)
|
|
614
|
+
|
|
615
|
+
const pluginOptions = {
|
|
616
|
+
root: path.join(__dirname, '/static')
|
|
617
|
+
}
|
|
618
|
+
const fastify = Fastify()
|
|
619
|
+
|
|
620
|
+
fastify.setErrorHandler(function errorHandler (err, _request, reply) {
|
|
621
|
+
reply.code(403).type('text/plain').send(`${err.statusCode} Custom error message`)
|
|
622
|
+
})
|
|
623
|
+
|
|
624
|
+
fastify.get('/index.js', (_, reply) => {
|
|
625
|
+
return reply.type('text/html').sendFile('foo.js')
|
|
626
|
+
})
|
|
627
|
+
|
|
628
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
629
|
+
|
|
630
|
+
t.after(() => fastify.close())
|
|
631
|
+
|
|
632
|
+
await fastify.listen({ port: 0 })
|
|
633
|
+
|
|
634
|
+
fastify.server.unref()
|
|
635
|
+
|
|
636
|
+
await t.test('/../index.js', async t => {
|
|
637
|
+
t.plan(4)
|
|
638
|
+
|
|
639
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.js')
|
|
640
|
+
t.assert.ok(!response.ok)
|
|
641
|
+
t.assert.deepStrictEqual(response.status, 403)
|
|
642
|
+
t.assert.deepStrictEqual(response.headers.get('content-type'), 'text/plain')
|
|
643
|
+
t.assert.deepStrictEqual(await response.text(), '500 Custom error message')
|
|
644
|
+
})
|
|
645
|
+
})
|
|
646
|
+
|
|
647
|
+
test('not found responses can be customized with fastify.setNotFoundHandler()', async t => {
|
|
648
|
+
t.plan(1)
|
|
649
|
+
|
|
650
|
+
const pluginOptions = {
|
|
651
|
+
root: path.join(__dirname, '/static')
|
|
652
|
+
}
|
|
653
|
+
const fastify = Fastify()
|
|
654
|
+
|
|
655
|
+
fastify.setNotFoundHandler(function notFoundHandler (request, reply) {
|
|
656
|
+
reply.code(404).type('text/plain').send(request.raw.url + ' Not Found')
|
|
657
|
+
})
|
|
658
|
+
|
|
659
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
660
|
+
|
|
661
|
+
t.after(() => fastify.close())
|
|
662
|
+
|
|
663
|
+
await fastify.listen({ port: 0 })
|
|
664
|
+
|
|
665
|
+
fastify.server.unref()
|
|
666
|
+
|
|
667
|
+
await t.test('/path/does/not/exist.html', async t => {
|
|
668
|
+
t.plan(4)
|
|
669
|
+
|
|
670
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/path/does/not/exist.html')
|
|
671
|
+
t.assert.ok(!response.ok)
|
|
672
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
673
|
+
t.assert.deepStrictEqual(response.headers.get('content-type'), 'text/plain')
|
|
674
|
+
t.assert.deepStrictEqual(await response.text(), '/path/does/not/exist.html Not Found')
|
|
675
|
+
})
|
|
676
|
+
})
|
|
677
|
+
|
|
678
|
+
test('fastify.setNotFoundHandler() is called for dotfiles when send is configured to ignore dotfiles', async t => {
|
|
679
|
+
t.plan(1)
|
|
680
|
+
|
|
681
|
+
const pluginOptions = {
|
|
682
|
+
root: path.join(__dirname, '/static'),
|
|
683
|
+
send: {
|
|
684
|
+
dotfiles: 'ignore'
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
const fastify = Fastify()
|
|
688
|
+
|
|
689
|
+
fastify.setNotFoundHandler(function notFoundHandler (request, reply) {
|
|
690
|
+
reply.code(404).type('text/plain').send(request.raw.url + ' Not Found')
|
|
691
|
+
})
|
|
692
|
+
|
|
693
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
694
|
+
|
|
695
|
+
t.after(() => fastify.close())
|
|
696
|
+
|
|
697
|
+
await fastify.listen({ port: 0 })
|
|
698
|
+
|
|
699
|
+
fastify.server.unref()
|
|
700
|
+
|
|
701
|
+
// Requesting files with a leading dot doesn't follow the same code path as
|
|
702
|
+
// other 404 errors
|
|
703
|
+
await t.test('/path/does/not/.exist.html', async t => {
|
|
704
|
+
t.plan(4)
|
|
705
|
+
|
|
706
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/path/does/not/.exist.html')
|
|
707
|
+
t.assert.ok(!response.ok)
|
|
708
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
709
|
+
t.assert.deepStrictEqual(response.headers.get('content-type'), 'text/plain')
|
|
710
|
+
t.assert.deepStrictEqual(await response.text(), '/path/does/not/.exist.html Not Found')
|
|
711
|
+
})
|
|
712
|
+
})
|
|
713
|
+
|
|
714
|
+
test('serving disabled', async (t) => {
|
|
715
|
+
t.plan(2)
|
|
716
|
+
|
|
717
|
+
const pluginOptions = {
|
|
718
|
+
root: path.join(__dirname, '/static'),
|
|
719
|
+
prefix: '/static/',
|
|
720
|
+
serve: false
|
|
721
|
+
}
|
|
722
|
+
const fastify = Fastify()
|
|
723
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
724
|
+
|
|
725
|
+
t.after(() => fastify.close())
|
|
726
|
+
|
|
727
|
+
fastify.get('/foo/bar', (_request, reply) => {
|
|
728
|
+
reply.sendFile('index.html')
|
|
729
|
+
})
|
|
730
|
+
|
|
731
|
+
t.after(() => fastify.close())
|
|
732
|
+
|
|
733
|
+
await fastify.listen({ port: 0 })
|
|
734
|
+
|
|
735
|
+
fastify.server.unref()
|
|
736
|
+
|
|
737
|
+
await t.test('/static/index.html not found', async (t) => {
|
|
738
|
+
t.plan(2)
|
|
739
|
+
|
|
740
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
741
|
+
t.assert.ok(!response.ok)
|
|
742
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
743
|
+
})
|
|
744
|
+
|
|
745
|
+
await t.test('/static/index.html via sendFile found', async (t) => {
|
|
746
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
747
|
+
|
|
748
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar')
|
|
749
|
+
t.assert.ok(response.ok)
|
|
750
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
751
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
752
|
+
genericResponseChecks(t, response)
|
|
753
|
+
})
|
|
754
|
+
})
|
|
755
|
+
|
|
756
|
+
test('serving disabled without root', async (t) => {
|
|
757
|
+
t.plan(2)
|
|
758
|
+
|
|
759
|
+
const pluginOptions = {
|
|
760
|
+
prefix: '/static/',
|
|
761
|
+
serve: false
|
|
762
|
+
}
|
|
763
|
+
const fastify = Fastify()
|
|
764
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
765
|
+
|
|
766
|
+
t.after(() => fastify.close())
|
|
767
|
+
|
|
768
|
+
fastify.get('/foo/bar/r', (_request, reply) => {
|
|
769
|
+
reply.sendFile('index.html')
|
|
770
|
+
})
|
|
771
|
+
|
|
772
|
+
fastify.get('/foo/bar/a', (_request, reply) => {
|
|
773
|
+
reply.sendFile(path.join(__dirname, pluginOptions.prefix, 'index.html'))
|
|
774
|
+
})
|
|
775
|
+
|
|
776
|
+
t.after(() => fastify.close())
|
|
777
|
+
|
|
778
|
+
await fastify.listen({ port: 0 })
|
|
779
|
+
|
|
780
|
+
fastify.server.unref()
|
|
781
|
+
|
|
782
|
+
await t.test('/static/index.html via sendFile not found', async (t) => {
|
|
783
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
784
|
+
|
|
785
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar/a')
|
|
786
|
+
t.assert.ok(response.ok)
|
|
787
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
788
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
789
|
+
genericResponseChecks(t, response)
|
|
790
|
+
})
|
|
791
|
+
|
|
792
|
+
await t.test('/static/index.html via sendFile with relative path not found', async (t) => {
|
|
793
|
+
t.plan(2)
|
|
794
|
+
|
|
795
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar/r')
|
|
796
|
+
t.assert.ok(!response.ok)
|
|
797
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
798
|
+
})
|
|
799
|
+
})
|
|
800
|
+
|
|
801
|
+
test('sendFile', async (t) => {
|
|
802
|
+
t.plan(4)
|
|
803
|
+
|
|
804
|
+
const pluginOptions = {
|
|
805
|
+
root: path.join(__dirname, '/static'),
|
|
806
|
+
prefix: '/static'
|
|
807
|
+
}
|
|
808
|
+
const fastify = Fastify()
|
|
809
|
+
const maxAge = Math.round(Math.random() * 10) * 10000
|
|
810
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
811
|
+
|
|
812
|
+
t.after(() => fastify.close())
|
|
813
|
+
|
|
814
|
+
fastify.get('/foo/bar', function (_req, reply) {
|
|
815
|
+
reply.sendFile('/index.html')
|
|
816
|
+
})
|
|
817
|
+
|
|
818
|
+
fastify.get('/root/path/override/test', (_request, reply) => {
|
|
819
|
+
reply.sendFile(
|
|
820
|
+
'/foo.html',
|
|
821
|
+
path.join(__dirname, 'static', 'deep', 'path', 'for', 'test', 'purpose')
|
|
822
|
+
)
|
|
823
|
+
})
|
|
824
|
+
|
|
825
|
+
fastify.get('/foo/bar/options/override/test', function (_req, reply) {
|
|
826
|
+
reply.sendFile('/index.html', { maxAge })
|
|
827
|
+
})
|
|
828
|
+
|
|
829
|
+
await fastify.listen({ port: 0 })
|
|
830
|
+
fastify.server.unref()
|
|
831
|
+
|
|
832
|
+
await t.test('reply.sendFile()', async (t) => {
|
|
833
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
834
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar')
|
|
835
|
+
t.assert.ok(response.ok)
|
|
836
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
837
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
838
|
+
genericResponseChecks(t, response)
|
|
839
|
+
})
|
|
840
|
+
|
|
841
|
+
await t.test('reply.sendFile() with rootPath', async (t) => {
|
|
842
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
843
|
+
|
|
844
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/root/path/override/test')
|
|
845
|
+
t.assert.ok(response.ok)
|
|
846
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
847
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
848
|
+
genericResponseChecks(t, response)
|
|
849
|
+
})
|
|
850
|
+
|
|
851
|
+
await t.test('reply.sendFile() again without root path', async (t) => {
|
|
852
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
853
|
+
|
|
854
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar')
|
|
855
|
+
t.assert.ok(response.ok)
|
|
856
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
857
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
858
|
+
genericResponseChecks(t, response)
|
|
859
|
+
})
|
|
860
|
+
|
|
861
|
+
await t.test('reply.sendFile() with options', async (t) => {
|
|
862
|
+
t.plan(4 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
863
|
+
|
|
864
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar/options/override/test')
|
|
865
|
+
t.assert.ok(response.ok)
|
|
866
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
867
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
868
|
+
t.assert.deepStrictEqual(response.headers.get('cache-control'), `public, max-age=${maxAge / 1000}`)
|
|
869
|
+
genericResponseChecks(t, response)
|
|
870
|
+
})
|
|
871
|
+
})
|
|
872
|
+
|
|
873
|
+
test('sendFile disabled', async (t) => {
|
|
874
|
+
t.plan(1)
|
|
875
|
+
|
|
876
|
+
const pluginOptions = {
|
|
877
|
+
root: path.join(__dirname, '/static'),
|
|
878
|
+
prefix: '/static',
|
|
879
|
+
decorateReply: false
|
|
880
|
+
}
|
|
881
|
+
const fastify = Fastify()
|
|
882
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
883
|
+
|
|
884
|
+
t.after(() => fastify.close())
|
|
885
|
+
|
|
886
|
+
fastify.get('/foo/bar', function (_req, reply) {
|
|
887
|
+
if (reply.sendFile === undefined) {
|
|
888
|
+
reply.send('pass')
|
|
889
|
+
} else {
|
|
890
|
+
reply.send('fail')
|
|
891
|
+
}
|
|
892
|
+
})
|
|
893
|
+
|
|
894
|
+
await fastify.listen({ port: 0 })
|
|
895
|
+
|
|
896
|
+
fastify.server.unref()
|
|
897
|
+
|
|
898
|
+
await t.test('reply.sendFile undefined', async (t) => {
|
|
899
|
+
t.plan(3)
|
|
900
|
+
|
|
901
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar')
|
|
902
|
+
t.assert.ok(response.ok)
|
|
903
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
904
|
+
t.assert.deepStrictEqual(await response.text(), 'pass')
|
|
905
|
+
})
|
|
906
|
+
})
|
|
907
|
+
|
|
908
|
+
test('allowedPath option - pathname', async (t) => {
|
|
909
|
+
t.plan(2)
|
|
910
|
+
|
|
911
|
+
const pluginOptions = {
|
|
912
|
+
root: path.join(__dirname, '/static'),
|
|
913
|
+
allowedPath: (pathName) => pathName !== '/foobar.html'
|
|
914
|
+
}
|
|
915
|
+
const fastify = Fastify()
|
|
916
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
917
|
+
|
|
918
|
+
t.after(() => fastify.close())
|
|
919
|
+
|
|
920
|
+
await fastify.listen({ port: 0 })
|
|
921
|
+
fastify.server.unref()
|
|
922
|
+
|
|
923
|
+
await t.test('/foobar.html not found', async (t) => {
|
|
924
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
925
|
+
|
|
926
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foobar.html')
|
|
927
|
+
t.assert.ok(!response.ok)
|
|
928
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
929
|
+
genericErrorResponseChecks(t, response)
|
|
930
|
+
})
|
|
931
|
+
|
|
932
|
+
await t.test('/index.css found', async (t) => {
|
|
933
|
+
t.plan(2)
|
|
934
|
+
|
|
935
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.css')
|
|
936
|
+
t.assert.ok(response.ok)
|
|
937
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
938
|
+
})
|
|
939
|
+
})
|
|
940
|
+
|
|
941
|
+
test('allowedPath option - request', async (t) => {
|
|
942
|
+
t.plan(2)
|
|
943
|
+
|
|
944
|
+
const pluginOptions = {
|
|
945
|
+
root: path.join(__dirname, '/static'),
|
|
946
|
+
allowedPath: (_pathName, _root, request) => request.query.key === 'temporaryKey'
|
|
947
|
+
}
|
|
948
|
+
const fastify = Fastify()
|
|
949
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
950
|
+
|
|
951
|
+
t.after(() => fastify.close())
|
|
952
|
+
|
|
953
|
+
await fastify.listen({ port: 0 })
|
|
954
|
+
|
|
955
|
+
fastify.server.unref()
|
|
956
|
+
|
|
957
|
+
await t.test('/foobar.html not found', async (t) => {
|
|
958
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
959
|
+
|
|
960
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foobar.html')
|
|
961
|
+
t.assert.ok(!response.ok)
|
|
962
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
963
|
+
genericErrorResponseChecks(t, response)
|
|
964
|
+
})
|
|
965
|
+
|
|
966
|
+
await t.test('/index.css found', async (t) => {
|
|
967
|
+
t.plan(2)
|
|
968
|
+
|
|
969
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.css?key=temporaryKey')
|
|
970
|
+
t.assert.ok(response.ok)
|
|
971
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
972
|
+
})
|
|
973
|
+
})
|
|
974
|
+
|
|
975
|
+
test('download', async (t) => {
|
|
976
|
+
t.plan(6)
|
|
977
|
+
|
|
978
|
+
const pluginOptions = {
|
|
979
|
+
root: path.join(__dirname, '/static'),
|
|
980
|
+
prefix: '/static'
|
|
981
|
+
}
|
|
982
|
+
const fastify = Fastify()
|
|
983
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
984
|
+
|
|
985
|
+
t.after(() => fastify.close())
|
|
986
|
+
|
|
987
|
+
fastify.get('/foo/bar', function (_req, reply) {
|
|
988
|
+
reply.download('/index.html')
|
|
989
|
+
})
|
|
990
|
+
|
|
991
|
+
fastify.get('/foo/bar/change', function (_req, reply) {
|
|
992
|
+
reply.download('/index.html', 'hello-world.html')
|
|
993
|
+
})
|
|
994
|
+
|
|
995
|
+
fastify.get('/foo/bar/override', function (_req, reply) {
|
|
996
|
+
reply.download('/index.html', 'hello-world.html', {
|
|
997
|
+
maxAge: '2 hours',
|
|
998
|
+
immutable: true
|
|
999
|
+
})
|
|
1000
|
+
})
|
|
1001
|
+
|
|
1002
|
+
fastify.get('/foo/bar/override/2', function (_req, reply) {
|
|
1003
|
+
reply.download('/index.html', { acceptRanges: false })
|
|
1004
|
+
})
|
|
1005
|
+
|
|
1006
|
+
fastify.get('/root/path/override/test', (_request, reply) => {
|
|
1007
|
+
reply.download('/foo.html', {
|
|
1008
|
+
root: path.join(
|
|
1009
|
+
__dirname,
|
|
1010
|
+
'static',
|
|
1011
|
+
'deep',
|
|
1012
|
+
'path',
|
|
1013
|
+
'for',
|
|
1014
|
+
'test',
|
|
1015
|
+
'purpose'
|
|
1016
|
+
)
|
|
1017
|
+
})
|
|
1018
|
+
})
|
|
1019
|
+
|
|
1020
|
+
fastify.get('/root/path/override/test/change', (_request, reply) => {
|
|
1021
|
+
reply.download('/foo.html', 'hello-world.html', {
|
|
1022
|
+
root: path.join(
|
|
1023
|
+
__dirname,
|
|
1024
|
+
'static',
|
|
1025
|
+
'deep',
|
|
1026
|
+
'path',
|
|
1027
|
+
'for',
|
|
1028
|
+
'test',
|
|
1029
|
+
'purpose'
|
|
1030
|
+
)
|
|
1031
|
+
})
|
|
1032
|
+
})
|
|
1033
|
+
|
|
1034
|
+
await fastify.listen({ port: 0 })
|
|
1035
|
+
|
|
1036
|
+
fastify.server.unref()
|
|
1037
|
+
|
|
1038
|
+
await t.test('reply.download()', async (t) => {
|
|
1039
|
+
t.plan(4 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1040
|
+
|
|
1041
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar')
|
|
1042
|
+
t.assert.ok(response.ok)
|
|
1043
|
+
t.assert.deepStrictEqual(response.headers.get('content-disposition'), 'attachment; filename="index.html"')
|
|
1044
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1045
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1046
|
+
genericResponseChecks(t, response)
|
|
1047
|
+
})
|
|
1048
|
+
|
|
1049
|
+
await t.test('reply.download() with fileName', async t => {
|
|
1050
|
+
t.plan(4 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1051
|
+
|
|
1052
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar/change')
|
|
1053
|
+
t.assert.ok(response.ok)
|
|
1054
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1055
|
+
t.assert.deepStrictEqual(response.headers.get('content-disposition'), 'attachment; filename="hello-world.html"')
|
|
1056
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1057
|
+
genericResponseChecks(t, response)
|
|
1058
|
+
})
|
|
1059
|
+
|
|
1060
|
+
await t.test('reply.download() with fileName - override', async (t) => {
|
|
1061
|
+
t.plan(4 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1062
|
+
|
|
1063
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/root/path/override/test')
|
|
1064
|
+
t.assert.ok(response.ok)
|
|
1065
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1066
|
+
t.assert.deepStrictEqual(response.headers.get('content-disposition'), 'attachment; filename="foo.html"')
|
|
1067
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
1068
|
+
genericResponseChecks(t, response)
|
|
1069
|
+
})
|
|
1070
|
+
|
|
1071
|
+
await t.test('reply.download() with custom opts', async (t) => {
|
|
1072
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1073
|
+
|
|
1074
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar/override')
|
|
1075
|
+
t.assert.ok(response.ok)
|
|
1076
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1077
|
+
t.assert.deepStrictEqual(response.headers.get('content-disposition'), 'attachment; filename="hello-world.html"')
|
|
1078
|
+
t.assert.deepStrictEqual(response.headers.get('cache-control'), 'public, max-age=7200, immutable')
|
|
1079
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1080
|
+
genericResponseChecks(t, response)
|
|
1081
|
+
})
|
|
1082
|
+
|
|
1083
|
+
await t.test('reply.download() with custom opts (2)', async (t) => {
|
|
1084
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1085
|
+
|
|
1086
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar/override/2')
|
|
1087
|
+
t.assert.ok(response.ok)
|
|
1088
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1089
|
+
t.assert.deepStrictEqual(response.headers.get('content-disposition'), 'attachment; filename="index.html"')
|
|
1090
|
+
t.assert.deepStrictEqual(response.headers.get('accept-ranges'), null)
|
|
1091
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1092
|
+
genericResponseChecks(t, response)
|
|
1093
|
+
})
|
|
1094
|
+
|
|
1095
|
+
await t.test('reply.download() with rootPath and fileName', async (t) => {
|
|
1096
|
+
t.plan(4 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1097
|
+
|
|
1098
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/root/path/override/test/change')
|
|
1099
|
+
t.assert.ok(response.ok)
|
|
1100
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1101
|
+
t.assert.deepStrictEqual(response.headers.get('content-disposition'), 'attachment; filename="hello-world.html"')
|
|
1102
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
1103
|
+
genericResponseChecks(t, response)
|
|
1104
|
+
})
|
|
1105
|
+
})
|
|
1106
|
+
|
|
1107
|
+
test('download disabled', async (t) => {
|
|
1108
|
+
t.plan(2)
|
|
1109
|
+
|
|
1110
|
+
const pluginOptions = {
|
|
1111
|
+
root: path.join(__dirname, '/static'),
|
|
1112
|
+
prefix: '/static',
|
|
1113
|
+
decorateReply: false
|
|
1114
|
+
}
|
|
1115
|
+
const fastify = Fastify()
|
|
1116
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1117
|
+
|
|
1118
|
+
fastify.get('/foo/bar', function (_req, reply) {
|
|
1119
|
+
if (reply.download === undefined) {
|
|
1120
|
+
t.assert.deepStrictEqual(reply.download, undefined)
|
|
1121
|
+
reply.send('pass')
|
|
1122
|
+
} else {
|
|
1123
|
+
reply.send('fail')
|
|
1124
|
+
}
|
|
1125
|
+
})
|
|
1126
|
+
|
|
1127
|
+
t.after(() => fastify.close())
|
|
1128
|
+
|
|
1129
|
+
await fastify.listen({ port: 0 })
|
|
1130
|
+
|
|
1131
|
+
fastify.server.unref()
|
|
1132
|
+
|
|
1133
|
+
await t.test('reply.sendFile undefined', async (t) => {
|
|
1134
|
+
t.plan(3)
|
|
1135
|
+
|
|
1136
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/foo/bar')
|
|
1137
|
+
t.assert.ok(response.ok)
|
|
1138
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1139
|
+
t.assert.deepStrictEqual(await response.text(), 'pass')
|
|
1140
|
+
})
|
|
1141
|
+
})
|
|
1142
|
+
|
|
1143
|
+
test('prefix default', (t) => {
|
|
1144
|
+
t.plan(1)
|
|
1145
|
+
const pluginOptions = { root: path.join(__dirname, 'static') }
|
|
1146
|
+
const fastify = Fastify({ logger: false })
|
|
1147
|
+
t.assert.doesNotThrow(() => fastify.register(fastifyStatic, pluginOptions))
|
|
1148
|
+
})
|
|
1149
|
+
|
|
1150
|
+
test('root not found warning', async (t) => {
|
|
1151
|
+
t.plan(1)
|
|
1152
|
+
const rootPath = path.join(__dirname, 'does-not-exist')
|
|
1153
|
+
const pluginOptions = { root: rootPath }
|
|
1154
|
+
const destination = concat((data) => {
|
|
1155
|
+
t.assert.deepStrictEqual(JSON.parse(data).msg, `"root" path "${rootPath}" must exist`)
|
|
1156
|
+
})
|
|
1157
|
+
const loggerInstance = pino(
|
|
1158
|
+
{
|
|
1159
|
+
level: 'warn'
|
|
1160
|
+
},
|
|
1161
|
+
destination
|
|
1162
|
+
)
|
|
1163
|
+
const fastify = Fastify({ loggerInstance })
|
|
1164
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1165
|
+
|
|
1166
|
+
await fastify.listen({ port: 0 })
|
|
1167
|
+
fastify.server.unref()
|
|
1168
|
+
destination.end()
|
|
1169
|
+
})
|
|
1170
|
+
|
|
1171
|
+
test('send options', (t) => {
|
|
1172
|
+
t.plan(12)
|
|
1173
|
+
const pluginOptions = {
|
|
1174
|
+
root: path.join(__dirname, '/static'),
|
|
1175
|
+
acceptRanges: 'acceptRanges',
|
|
1176
|
+
contentType: 'contentType',
|
|
1177
|
+
cacheControl: 'cacheControl',
|
|
1178
|
+
dotfiles: 'dotfiles',
|
|
1179
|
+
etag: 'etag',
|
|
1180
|
+
extensions: 'extensions',
|
|
1181
|
+
immutable: 'immutable',
|
|
1182
|
+
index: 'index',
|
|
1183
|
+
lastModified: 'lastModified',
|
|
1184
|
+
maxAge: 'maxAge'
|
|
1185
|
+
}
|
|
1186
|
+
const fastify = Fastify({ logger: false })
|
|
1187
|
+
const { resolve, promise } = Promise.withResolvers()
|
|
1188
|
+
const fastifyStatic = require('proxyquire')('../', {
|
|
1189
|
+
'@fastify/send': function sendStub (_req, pathName, options) {
|
|
1190
|
+
t.assert.deepStrictEqual(pathName, '/index.html')
|
|
1191
|
+
t.assert.deepStrictEqual(options.root, path.join(__dirname, '/static'))
|
|
1192
|
+
t.assert.deepStrictEqual(options.acceptRanges, 'acceptRanges')
|
|
1193
|
+
t.assert.deepStrictEqual(options.contentType, 'contentType')
|
|
1194
|
+
t.assert.deepStrictEqual(options.cacheControl, 'cacheControl')
|
|
1195
|
+
t.assert.deepStrictEqual(options.dotfiles, 'dotfiles')
|
|
1196
|
+
t.assert.deepStrictEqual(options.etag, 'etag')
|
|
1197
|
+
t.assert.deepStrictEqual(options.extensions, 'extensions')
|
|
1198
|
+
t.assert.deepStrictEqual(options.immutable, 'immutable')
|
|
1199
|
+
t.assert.deepStrictEqual(options.index, 'index')
|
|
1200
|
+
t.assert.deepStrictEqual(options.lastModified, 'lastModified')
|
|
1201
|
+
t.assert.deepStrictEqual(options.maxAge, 'maxAge')
|
|
1202
|
+
resolve()
|
|
1203
|
+
return { on: () => { }, pipe: () => { } }
|
|
1204
|
+
}
|
|
1205
|
+
})
|
|
1206
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1207
|
+
fastify.inject({ url: '/index.html' })
|
|
1208
|
+
|
|
1209
|
+
return promise
|
|
1210
|
+
})
|
|
1211
|
+
|
|
1212
|
+
test('setHeaders option', async (t) => {
|
|
1213
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1214
|
+
|
|
1215
|
+
const pluginOptions = {
|
|
1216
|
+
root: path.join(__dirname, 'static'),
|
|
1217
|
+
setHeaders: function (res, pathName) {
|
|
1218
|
+
t.assert.deepStrictEqual(pathName, path.join(__dirname, 'static/index.html'))
|
|
1219
|
+
res.setHeader('X-Test-Header', 'test')
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
const fastify = Fastify()
|
|
1223
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1224
|
+
|
|
1225
|
+
t.after(() => fastify.close())
|
|
1226
|
+
|
|
1227
|
+
await fastify.listen({ port: 0 })
|
|
1228
|
+
|
|
1229
|
+
fastify.server.unref()
|
|
1230
|
+
|
|
1231
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html')
|
|
1232
|
+
t.assert.ok(response.ok)
|
|
1233
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1234
|
+
t.assert.deepStrictEqual(response.headers.get('x-test-header'), 'test')
|
|
1235
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1236
|
+
genericResponseChecks(t, response)
|
|
1237
|
+
})
|
|
1238
|
+
|
|
1239
|
+
test('maxAge option', async (t) => {
|
|
1240
|
+
t.plan(4 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1241
|
+
|
|
1242
|
+
const pluginOptions = {
|
|
1243
|
+
root: path.join(__dirname, 'static'),
|
|
1244
|
+
maxAge: 3600000
|
|
1245
|
+
}
|
|
1246
|
+
const fastify = Fastify()
|
|
1247
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1248
|
+
|
|
1249
|
+
t.after(() => fastify.close())
|
|
1250
|
+
|
|
1251
|
+
await fastify.listen({ port: 0 })
|
|
1252
|
+
fastify.server.unref()
|
|
1253
|
+
|
|
1254
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html')
|
|
1255
|
+
t.assert.ok(response.ok)
|
|
1256
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1257
|
+
t.assert.deepStrictEqual(response.headers.get('cache-control'), 'public, max-age=3600')
|
|
1258
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1259
|
+
genericResponseChecks(t, response)
|
|
1260
|
+
})
|
|
1261
|
+
|
|
1262
|
+
test('errors', async (t) => {
|
|
1263
|
+
t.plan(12)
|
|
1264
|
+
|
|
1265
|
+
await t.test('no root', async (t) => {
|
|
1266
|
+
t.plan(1)
|
|
1267
|
+
const pluginOptions = {}
|
|
1268
|
+
const fastify = Fastify({ logger: false })
|
|
1269
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1270
|
+
})
|
|
1271
|
+
|
|
1272
|
+
await t.test('root is not a string', async (t) => {
|
|
1273
|
+
t.plan(1)
|
|
1274
|
+
const pluginOptions = { root: 42 }
|
|
1275
|
+
const fastify = Fastify({ logger: false })
|
|
1276
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1277
|
+
})
|
|
1278
|
+
|
|
1279
|
+
await t.test('root is not an absolute path', async (t) => {
|
|
1280
|
+
t.plan(1)
|
|
1281
|
+
const pluginOptions = { root: './my/path' }
|
|
1282
|
+
const fastify = Fastify({ logger: false })
|
|
1283
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1284
|
+
})
|
|
1285
|
+
|
|
1286
|
+
await t.test('root is not a directory', async (t) => {
|
|
1287
|
+
t.plan(1)
|
|
1288
|
+
const pluginOptions = { root: __filename }
|
|
1289
|
+
const fastify = Fastify({ logger: false })
|
|
1290
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1291
|
+
})
|
|
1292
|
+
|
|
1293
|
+
await t.test('root is an empty array', async (t) => {
|
|
1294
|
+
t.plan(1)
|
|
1295
|
+
const pluginOptions = { root: [] }
|
|
1296
|
+
const fastify = Fastify({ logger: false })
|
|
1297
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1298
|
+
})
|
|
1299
|
+
|
|
1300
|
+
await t.test('root array does not contain strings', async (t) => {
|
|
1301
|
+
t.plan(1)
|
|
1302
|
+
const pluginOptions = { root: [1] }
|
|
1303
|
+
const fastify = Fastify({ logger: false })
|
|
1304
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1305
|
+
})
|
|
1306
|
+
|
|
1307
|
+
await t.test('root array does not contain an absolute path', async (t) => {
|
|
1308
|
+
t.plan(1)
|
|
1309
|
+
const pluginOptions = { root: ['./my/path'] }
|
|
1310
|
+
const fastify = Fastify({ logger: false })
|
|
1311
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1312
|
+
})
|
|
1313
|
+
|
|
1314
|
+
await t.test('root array path is not a directory', async (t) => {
|
|
1315
|
+
t.plan(1)
|
|
1316
|
+
const pluginOptions = { root: [__filename] }
|
|
1317
|
+
const fastify = Fastify({ logger: false })
|
|
1318
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1319
|
+
})
|
|
1320
|
+
|
|
1321
|
+
await t.test('all root array paths must be valid', async (t) => {
|
|
1322
|
+
t.plan(1)
|
|
1323
|
+
const pluginOptions = { root: [path.join(__dirname, '/static'), 1] }
|
|
1324
|
+
const fastify = Fastify({ logger: false })
|
|
1325
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1326
|
+
})
|
|
1327
|
+
|
|
1328
|
+
await t.test('no root and serve: false', async (t) => {
|
|
1329
|
+
t.plan(1)
|
|
1330
|
+
const pluginOptions = {
|
|
1331
|
+
serve: false,
|
|
1332
|
+
root: []
|
|
1333
|
+
}
|
|
1334
|
+
const fastify = Fastify({ logger: false })
|
|
1335
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1336
|
+
})
|
|
1337
|
+
|
|
1338
|
+
await t.test('duplicate root paths are not allowed', async (t) => {
|
|
1339
|
+
t.plan(1)
|
|
1340
|
+
const pluginOptions = {
|
|
1341
|
+
root: [path.join(__dirname, '/static'), path.join(__dirname, '/static')]
|
|
1342
|
+
}
|
|
1343
|
+
const fastify = Fastify({ logger: false })
|
|
1344
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1345
|
+
})
|
|
1346
|
+
|
|
1347
|
+
await t.test('setHeaders is not a function', async (t) => {
|
|
1348
|
+
t.plan(1)
|
|
1349
|
+
const pluginOptions = { root: __dirname, setHeaders: 'headers' }
|
|
1350
|
+
const fastify = Fastify({ logger: false })
|
|
1351
|
+
await t.assert.rejects(async () => await fastify.register(fastifyStatic, pluginOptions))
|
|
1352
|
+
})
|
|
1353
|
+
})
|
|
1354
|
+
|
|
1355
|
+
test('register no prefix', async (t) => {
|
|
1356
|
+
t.plan(7)
|
|
1357
|
+
|
|
1358
|
+
const pluginOptions = {
|
|
1359
|
+
root: path.join(__dirname, '/static')
|
|
1360
|
+
}
|
|
1361
|
+
const fastify = Fastify()
|
|
1362
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1363
|
+
|
|
1364
|
+
fastify.get('/', (_request, reply) => {
|
|
1365
|
+
reply.send({ hello: 'world' })
|
|
1366
|
+
})
|
|
1367
|
+
|
|
1368
|
+
t.after(() => fastify.close())
|
|
1369
|
+
|
|
1370
|
+
await fastify.listen({ port: 0 })
|
|
1371
|
+
|
|
1372
|
+
fastify.server.unref()
|
|
1373
|
+
|
|
1374
|
+
await t.test('/index.html', async (t) => {
|
|
1375
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1376
|
+
|
|
1377
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html')
|
|
1378
|
+
t.assert.ok(response.ok)
|
|
1379
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1380
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1381
|
+
genericResponseChecks(t, response)
|
|
1382
|
+
})
|
|
1383
|
+
|
|
1384
|
+
await t.test('/index.css', async (t) => {
|
|
1385
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1386
|
+
|
|
1387
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.css')
|
|
1388
|
+
t.assert.ok(response.ok)
|
|
1389
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1390
|
+
genericResponseChecks(t, response)
|
|
1391
|
+
})
|
|
1392
|
+
|
|
1393
|
+
await t.test('/', async (t) => {
|
|
1394
|
+
t.plan(3)
|
|
1395
|
+
|
|
1396
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port)
|
|
1397
|
+
t.assert.ok(response.ok)
|
|
1398
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1399
|
+
t.assert.deepStrictEqual(await response.json(), { hello: 'world' })
|
|
1400
|
+
})
|
|
1401
|
+
|
|
1402
|
+
await t.test('/deep/path/for/test/purpose/foo.html', async (t) => {
|
|
1403
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1404
|
+
|
|
1405
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/deep/path/for/test/purpose/foo.html')
|
|
1406
|
+
t.assert.ok(response.ok)
|
|
1407
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1408
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
1409
|
+
genericResponseChecks(t, response)
|
|
1410
|
+
})
|
|
1411
|
+
|
|
1412
|
+
await t.test('/deep/path/for/test/', async (t) => {
|
|
1413
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1414
|
+
|
|
1415
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/deep/path/for/test/')
|
|
1416
|
+
t.assert.ok(response.ok)
|
|
1417
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1418
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
1419
|
+
genericResponseChecks(t, response)
|
|
1420
|
+
})
|
|
1421
|
+
|
|
1422
|
+
await t.test('/this/path/doesnt/exist.html', async (t) => {
|
|
1423
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
1424
|
+
|
|
1425
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/this/path/doesnt/exist.html')
|
|
1426
|
+
t.assert.ok(!response.ok)
|
|
1427
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
1428
|
+
genericErrorResponseChecks(t, response)
|
|
1429
|
+
})
|
|
1430
|
+
|
|
1431
|
+
await t.test('/../index.js', async (t) => {
|
|
1432
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
1433
|
+
|
|
1434
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/../index.js')
|
|
1435
|
+
t.assert.ok(!response.ok)
|
|
1436
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
1437
|
+
genericErrorResponseChecks(t, response)
|
|
1438
|
+
})
|
|
1439
|
+
})
|
|
1440
|
+
|
|
1441
|
+
test('with fastify-compress', async t => {
|
|
1442
|
+
t.plan(2)
|
|
1443
|
+
|
|
1444
|
+
const pluginOptions = {
|
|
1445
|
+
root: path.join(__dirname, '/static')
|
|
1446
|
+
}
|
|
1447
|
+
const fastify = Fastify()
|
|
1448
|
+
fastify.register(compress, { threshold: 0 })
|
|
1449
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1450
|
+
|
|
1451
|
+
t.after(() => fastify.close())
|
|
1452
|
+
|
|
1453
|
+
await fastify.listen({ port: 0 })
|
|
1454
|
+
|
|
1455
|
+
await t.test('deflate', async function (t) {
|
|
1456
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1457
|
+
|
|
1458
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html', {
|
|
1459
|
+
headers: {
|
|
1460
|
+
'accept-encoding': ['deflate']
|
|
1461
|
+
}
|
|
1462
|
+
})
|
|
1463
|
+
t.assert.ok(response.ok)
|
|
1464
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1465
|
+
t.assert.deepStrictEqual(response.headers.get('content-encoding'), 'deflate')
|
|
1466
|
+
genericResponseChecks(t, response)
|
|
1467
|
+
})
|
|
1468
|
+
|
|
1469
|
+
await t.test('gzip', async function (t) {
|
|
1470
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1471
|
+
|
|
1472
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html')
|
|
1473
|
+
t.assert.ok(response.ok)
|
|
1474
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1475
|
+
t.assert.deepStrictEqual(response.headers.get('content-encoding'), 'gzip')
|
|
1476
|
+
genericResponseChecks(t, response)
|
|
1477
|
+
})
|
|
1478
|
+
})
|
|
1479
|
+
test('register /static/ with schemaHide true', async t => {
|
|
1480
|
+
t.plan(2)
|
|
1481
|
+
|
|
1482
|
+
const pluginOptions = {
|
|
1483
|
+
root: path.join(__dirname, '/static'),
|
|
1484
|
+
prefix: '/static/',
|
|
1485
|
+
schemaHide: true
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
const fastify = Fastify()
|
|
1489
|
+
|
|
1490
|
+
fastify.addHook('onRoute', function (routeOptions) {
|
|
1491
|
+
t.assert.deepStrictEqual(routeOptions.schema, { hide: true })
|
|
1492
|
+
})
|
|
1493
|
+
|
|
1494
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1495
|
+
|
|
1496
|
+
t.after(() => fastify.close())
|
|
1497
|
+
|
|
1498
|
+
await fastify.listen({ port: 0 })
|
|
1499
|
+
|
|
1500
|
+
fastify.server.unref()
|
|
1501
|
+
|
|
1502
|
+
await t.test('/static/index.html', async (t) => {
|
|
1503
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1504
|
+
|
|
1505
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
1506
|
+
t.assert.ok(response.ok)
|
|
1507
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1508
|
+
t.assert.deepStrictEqual(response.headers.get('content-type'), 'text/html; charset=utf-8')
|
|
1509
|
+
genericResponseChecks(t, response)
|
|
1510
|
+
})
|
|
1511
|
+
})
|
|
1512
|
+
|
|
1513
|
+
test('register /static/ with schemaHide false', async t => {
|
|
1514
|
+
t.plan(2)
|
|
1515
|
+
|
|
1516
|
+
const pluginOptions = {
|
|
1517
|
+
root: path.join(__dirname, '/static'),
|
|
1518
|
+
prefix: '/static/',
|
|
1519
|
+
schemaHide: false
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
const fastify = Fastify()
|
|
1523
|
+
|
|
1524
|
+
fastify.addHook('onRoute', function (routeOptions) {
|
|
1525
|
+
t.assert.deepStrictEqual(routeOptions.schema, { hide: false })
|
|
1526
|
+
})
|
|
1527
|
+
|
|
1528
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1529
|
+
|
|
1530
|
+
t.after(() => fastify.close())
|
|
1531
|
+
|
|
1532
|
+
await fastify.listen({ port: 0 })
|
|
1533
|
+
|
|
1534
|
+
fastify.server.unref()
|
|
1535
|
+
|
|
1536
|
+
await t.test('/static/index.html', async (t) => {
|
|
1537
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1538
|
+
|
|
1539
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
1540
|
+
t.assert.ok(response.ok)
|
|
1541
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1542
|
+
t.assert.deepStrictEqual(response.headers.get('content-type'), 'text/html; charset=utf-8')
|
|
1543
|
+
genericResponseChecks(t, response)
|
|
1544
|
+
})
|
|
1545
|
+
})
|
|
1546
|
+
|
|
1547
|
+
test('register /static/ without schemaHide', async t => {
|
|
1548
|
+
t.plan(2)
|
|
1549
|
+
|
|
1550
|
+
const pluginOptions = {
|
|
1551
|
+
root: path.join(__dirname, '/static'),
|
|
1552
|
+
prefix: '/static/'
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
const fastify = Fastify()
|
|
1556
|
+
|
|
1557
|
+
fastify.addHook('onRoute', function (routeOptions) {
|
|
1558
|
+
t.assert.deepStrictEqual(routeOptions.schema, { hide: true })
|
|
1559
|
+
})
|
|
1560
|
+
|
|
1561
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1562
|
+
|
|
1563
|
+
t.after(() => fastify.close())
|
|
1564
|
+
|
|
1565
|
+
await fastify.listen({ port: 0 })
|
|
1566
|
+
|
|
1567
|
+
fastify.server.unref()
|
|
1568
|
+
|
|
1569
|
+
await t.test('/static/index.html', async (t) => {
|
|
1570
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1571
|
+
|
|
1572
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
1573
|
+
t.assert.ok(response.ok)
|
|
1574
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1575
|
+
t.assert.deepStrictEqual(response.headers.get('content-type'), 'text/html; charset=utf-8')
|
|
1576
|
+
genericResponseChecks(t, response)
|
|
1577
|
+
})
|
|
1578
|
+
})
|
|
1579
|
+
|
|
1580
|
+
test('fastify with exposeHeadRoutes', async t => {
|
|
1581
|
+
t.plan(1)
|
|
1582
|
+
|
|
1583
|
+
const pluginOptions = {
|
|
1584
|
+
root: path.join(__dirname, '/static'),
|
|
1585
|
+
wildcard: false
|
|
1586
|
+
}
|
|
1587
|
+
const fastify = Fastify()
|
|
1588
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1589
|
+
|
|
1590
|
+
t.after(() => fastify.close())
|
|
1591
|
+
|
|
1592
|
+
await fastify.listen({ port: 0 })
|
|
1593
|
+
|
|
1594
|
+
fastify.server.unref()
|
|
1595
|
+
|
|
1596
|
+
await t.test('/index.html', async t => {
|
|
1597
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1598
|
+
|
|
1599
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html', { method: 'HEAD' })
|
|
1600
|
+
t.assert.ok(response.ok)
|
|
1601
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1602
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
1603
|
+
genericResponseChecks(t, response)
|
|
1604
|
+
})
|
|
1605
|
+
})
|
|
1606
|
+
|
|
1607
|
+
test('register with wildcard false', async t => {
|
|
1608
|
+
t.plan(8)
|
|
1609
|
+
|
|
1610
|
+
const pluginOptions = {
|
|
1611
|
+
root: path.join(__dirname, '/static'),
|
|
1612
|
+
wildcard: false
|
|
1613
|
+
}
|
|
1614
|
+
const fastify = Fastify()
|
|
1615
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1616
|
+
|
|
1617
|
+
fastify.get('/*', (_request, reply) => {
|
|
1618
|
+
reply.send({ hello: 'world' })
|
|
1619
|
+
})
|
|
1620
|
+
|
|
1621
|
+
t.after(() => fastify.close())
|
|
1622
|
+
|
|
1623
|
+
await fastify.listen({ port: 0 })
|
|
1624
|
+
|
|
1625
|
+
fastify.server.unref()
|
|
1626
|
+
|
|
1627
|
+
await t.test('/index.html', async t => {
|
|
1628
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1629
|
+
|
|
1630
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html')
|
|
1631
|
+
t.assert.ok(response.ok)
|
|
1632
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1633
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1634
|
+
genericResponseChecks(t, response)
|
|
1635
|
+
})
|
|
1636
|
+
|
|
1637
|
+
await t.test('/index.css', async (t) => {
|
|
1638
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1639
|
+
|
|
1640
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.css')
|
|
1641
|
+
t.assert.ok(response.ok)
|
|
1642
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1643
|
+
genericResponseChecks(t, response)
|
|
1644
|
+
})
|
|
1645
|
+
|
|
1646
|
+
await t.test('/', async (t) => {
|
|
1647
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1648
|
+
|
|
1649
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port)
|
|
1650
|
+
t.assert.ok(response.ok)
|
|
1651
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1652
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1653
|
+
genericResponseChecks(t, response)
|
|
1654
|
+
})
|
|
1655
|
+
|
|
1656
|
+
await t.test('/not-defined', async (t) => {
|
|
1657
|
+
t.plan(3)
|
|
1658
|
+
|
|
1659
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/not-defined')
|
|
1660
|
+
t.assert.ok(response.ok)
|
|
1661
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1662
|
+
t.assert.deepStrictEqual(await response.json(), { hello: 'world' })
|
|
1663
|
+
})
|
|
1664
|
+
|
|
1665
|
+
await t.test('/deep/path/for/test/purpose/foo.html', async (t) => {
|
|
1666
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1667
|
+
|
|
1668
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/deep/path/for/test/purpose/foo.html')
|
|
1669
|
+
t.assert.ok(response.ok)
|
|
1670
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1671
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
1672
|
+
genericResponseChecks(t, response)
|
|
1673
|
+
})
|
|
1674
|
+
|
|
1675
|
+
await t.test('/deep/path/for/test/', async (t) => {
|
|
1676
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1677
|
+
|
|
1678
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/deep/path/for/test/')
|
|
1679
|
+
t.assert.ok(response.ok)
|
|
1680
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1681
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
1682
|
+
genericResponseChecks(t, response)
|
|
1683
|
+
})
|
|
1684
|
+
|
|
1685
|
+
await t.test('/../index.js', async (t) => {
|
|
1686
|
+
t.plan(3)
|
|
1687
|
+
|
|
1688
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/../index.js')
|
|
1689
|
+
t.assert.ok(response.ok)
|
|
1690
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1691
|
+
t.assert.deepStrictEqual(await response.json(), { hello: 'world' })
|
|
1692
|
+
})
|
|
1693
|
+
|
|
1694
|
+
await t.test('/index.css', async t => {
|
|
1695
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1696
|
+
|
|
1697
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.css')
|
|
1698
|
+
t.assert.ok(response.ok)
|
|
1699
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1700
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
1701
|
+
genericResponseChecks(t, response)
|
|
1702
|
+
})
|
|
1703
|
+
})
|
|
1704
|
+
|
|
1705
|
+
test('register with wildcard false (trailing slash in the root)', async t => {
|
|
1706
|
+
t.plan(5)
|
|
1707
|
+
|
|
1708
|
+
const pluginOptions = {
|
|
1709
|
+
root: path.join(__dirname, '/static/'),
|
|
1710
|
+
prefix: '/assets/',
|
|
1711
|
+
index: false,
|
|
1712
|
+
wildcard: false
|
|
1713
|
+
}
|
|
1714
|
+
const fastify = Fastify({
|
|
1715
|
+
ignoreTrailingSlash: true
|
|
1716
|
+
})
|
|
1717
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1718
|
+
|
|
1719
|
+
fastify.get('/*', (_request, reply) => {
|
|
1720
|
+
reply.send({ hello: 'world' })
|
|
1721
|
+
})
|
|
1722
|
+
|
|
1723
|
+
t.after(() => fastify.close())
|
|
1724
|
+
|
|
1725
|
+
await fastify.listen({ port: 0 })
|
|
1726
|
+
|
|
1727
|
+
fastify.server.unref()
|
|
1728
|
+
|
|
1729
|
+
await t.test('/index.css', async (t) => {
|
|
1730
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1731
|
+
|
|
1732
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/assets/index.css')
|
|
1733
|
+
t.assert.ok(response.ok)
|
|
1734
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1735
|
+
genericResponseChecks(t, response)
|
|
1736
|
+
})
|
|
1737
|
+
|
|
1738
|
+
await t.test('/not-defined', async (t) => {
|
|
1739
|
+
t.plan(3)
|
|
1740
|
+
|
|
1741
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/assets/not-defined')
|
|
1742
|
+
t.assert.ok(response.ok)
|
|
1743
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1744
|
+
t.assert.deepStrictEqual(await response.json(), { hello: 'world' })
|
|
1745
|
+
})
|
|
1746
|
+
|
|
1747
|
+
await t.test('/deep/path/for/test/purpose/foo.html', async (t) => {
|
|
1748
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1749
|
+
|
|
1750
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/assets/deep/path/for/test/purpose/foo.html')
|
|
1751
|
+
t.assert.ok(response.ok)
|
|
1752
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1753
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
1754
|
+
genericResponseChecks(t, response)
|
|
1755
|
+
})
|
|
1756
|
+
|
|
1757
|
+
await t.test('/../index.js', async (t) => {
|
|
1758
|
+
t.plan(3)
|
|
1759
|
+
|
|
1760
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/assets/../index.js')
|
|
1761
|
+
t.assert.ok(response.ok)
|
|
1762
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1763
|
+
t.assert.deepStrictEqual(await response.json(), { hello: 'world' })
|
|
1764
|
+
})
|
|
1765
|
+
|
|
1766
|
+
await t.test('/index.css', async t => {
|
|
1767
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1768
|
+
|
|
1769
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/assets/index.css')
|
|
1770
|
+
t.assert.ok(response.ok)
|
|
1771
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1772
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
1773
|
+
genericResponseChecks(t, response)
|
|
1774
|
+
})
|
|
1775
|
+
})
|
|
1776
|
+
|
|
1777
|
+
test('register with wildcard string', async (t) => {
|
|
1778
|
+
t.plan(1)
|
|
1779
|
+
|
|
1780
|
+
const pluginOptions = {
|
|
1781
|
+
root: path.join(__dirname, '/static'),
|
|
1782
|
+
wildcard: '**/index.html'
|
|
1783
|
+
}
|
|
1784
|
+
const fastify = Fastify()
|
|
1785
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1786
|
+
|
|
1787
|
+
fastify.get('/*', (_request, reply) => {
|
|
1788
|
+
reply.send({ hello: 'world' })
|
|
1789
|
+
})
|
|
1790
|
+
|
|
1791
|
+
await t.assert.rejects(fastify.ready())
|
|
1792
|
+
})
|
|
1793
|
+
|
|
1794
|
+
test('register with wildcard string on multiple root paths', async (t) => {
|
|
1795
|
+
t.plan(1)
|
|
1796
|
+
|
|
1797
|
+
const pluginOptions = {
|
|
1798
|
+
root: [path.join(__dirname, '/static'), path.join(__dirname, '/static2')],
|
|
1799
|
+
wildcard: '**/*.js'
|
|
1800
|
+
}
|
|
1801
|
+
const fastify = Fastify()
|
|
1802
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1803
|
+
|
|
1804
|
+
fastify.get('/*', (_request, reply) => {
|
|
1805
|
+
reply.send({ hello: 'world' })
|
|
1806
|
+
})
|
|
1807
|
+
|
|
1808
|
+
t.after(() => fastify.close())
|
|
1809
|
+
|
|
1810
|
+
await t.assert.rejects(fastify.listen({ port: 0 }))
|
|
1811
|
+
})
|
|
1812
|
+
|
|
1813
|
+
test('register with wildcard false and alternative index', async t => {
|
|
1814
|
+
t.plan(10)
|
|
1815
|
+
|
|
1816
|
+
const pluginOptions = {
|
|
1817
|
+
root: path.join(__dirname, '/static'),
|
|
1818
|
+
wildcard: false,
|
|
1819
|
+
index: ['foobar.html', 'foo.html', 'index.html']
|
|
1820
|
+
}
|
|
1821
|
+
const fastify = Fastify()
|
|
1822
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1823
|
+
|
|
1824
|
+
fastify.get('/*', (_request, reply) => {
|
|
1825
|
+
reply.send({ hello: 'world' })
|
|
1826
|
+
})
|
|
1827
|
+
|
|
1828
|
+
t.after(() => fastify.close())
|
|
1829
|
+
|
|
1830
|
+
await fastify.listen({ port: 0 })
|
|
1831
|
+
|
|
1832
|
+
fastify.server.unref()
|
|
1833
|
+
|
|
1834
|
+
await t.test('/index.html', async (t) => {
|
|
1835
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1836
|
+
|
|
1837
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html')
|
|
1838
|
+
t.assert.ok(response.ok)
|
|
1839
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1840
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1841
|
+
genericResponseChecks(t, response)
|
|
1842
|
+
})
|
|
1843
|
+
|
|
1844
|
+
await t.test('/index.html', async t => {
|
|
1845
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1846
|
+
|
|
1847
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html', { method: 'HEAD' })
|
|
1848
|
+
t.assert.ok(response.ok)
|
|
1849
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1850
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
1851
|
+
genericResponseChecks(t, response)
|
|
1852
|
+
})
|
|
1853
|
+
|
|
1854
|
+
await t.test('/index.css', async (t) => {
|
|
1855
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1856
|
+
|
|
1857
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.css')
|
|
1858
|
+
t.assert.ok(response.ok)
|
|
1859
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1860
|
+
genericResponseChecks(t, response)
|
|
1861
|
+
})
|
|
1862
|
+
|
|
1863
|
+
await t.test('/?a=b', async (t) => {
|
|
1864
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1865
|
+
|
|
1866
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port)
|
|
1867
|
+
t.assert.ok(response.ok)
|
|
1868
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1869
|
+
t.assert.deepStrictEqual(await response.text(), foobarContent)
|
|
1870
|
+
genericResponseChecks(t, response)
|
|
1871
|
+
})
|
|
1872
|
+
|
|
1873
|
+
await t.test('/?a=b', async t => {
|
|
1874
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1875
|
+
|
|
1876
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port, {
|
|
1877
|
+
method: 'HEAD'
|
|
1878
|
+
})
|
|
1879
|
+
t.assert.ok(response.ok)
|
|
1880
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1881
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
1882
|
+
genericResponseChecks(t, response)
|
|
1883
|
+
})
|
|
1884
|
+
|
|
1885
|
+
await t.test('/not-defined', async (t) => {
|
|
1886
|
+
t.plan(3)
|
|
1887
|
+
|
|
1888
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/not-defined')
|
|
1889
|
+
t.assert.ok(response.ok)
|
|
1890
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1891
|
+
t.assert.deepStrictEqual(await response.json(), { hello: 'world' })
|
|
1892
|
+
})
|
|
1893
|
+
|
|
1894
|
+
await t.test('/deep/path/for/test/purpose/', async (t) => {
|
|
1895
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1896
|
+
|
|
1897
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/deep/path/for/test/purpose/')
|
|
1898
|
+
t.assert.ok(response.ok)
|
|
1899
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1900
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
1901
|
+
genericResponseChecks(t, response)
|
|
1902
|
+
})
|
|
1903
|
+
|
|
1904
|
+
await t.test('/deep/path/for/test/', async (t) => {
|
|
1905
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1906
|
+
|
|
1907
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/deep/path/for/test/')
|
|
1908
|
+
t.assert.ok(response.ok)
|
|
1909
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1910
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
1911
|
+
genericResponseChecks(t, response)
|
|
1912
|
+
})
|
|
1913
|
+
|
|
1914
|
+
await t.test('/deep/path/for/test/', async t => {
|
|
1915
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1916
|
+
|
|
1917
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/deep/path/for/test/', {
|
|
1918
|
+
method: 'HEAD'
|
|
1919
|
+
})
|
|
1920
|
+
t.assert.ok(response.ok)
|
|
1921
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1922
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
1923
|
+
genericResponseChecks(t, response)
|
|
1924
|
+
})
|
|
1925
|
+
|
|
1926
|
+
await t.test('/../index.js', async (t) => {
|
|
1927
|
+
t.plan(3)
|
|
1928
|
+
|
|
1929
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/../index.js')
|
|
1930
|
+
t.assert.ok(response.ok)
|
|
1931
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1932
|
+
t.assert.deepStrictEqual(await response.json(), { hello: 'world' })
|
|
1933
|
+
})
|
|
1934
|
+
})
|
|
1935
|
+
|
|
1936
|
+
test('register /static with wildcard false and alternative index', async t => {
|
|
1937
|
+
t.plan(10)
|
|
1938
|
+
|
|
1939
|
+
const pluginOptions = {
|
|
1940
|
+
root: path.join(__dirname, '/static'),
|
|
1941
|
+
prefix: '/static',
|
|
1942
|
+
wildcard: false,
|
|
1943
|
+
index: ['foobar.html', 'foo.html', 'index.html']
|
|
1944
|
+
}
|
|
1945
|
+
const fastify = Fastify()
|
|
1946
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
1947
|
+
|
|
1948
|
+
fastify.get('/*', (_request, reply) => {
|
|
1949
|
+
reply.send({ hello: 'world' })
|
|
1950
|
+
})
|
|
1951
|
+
|
|
1952
|
+
t.after(() => fastify.close())
|
|
1953
|
+
|
|
1954
|
+
await fastify.listen({ port: 0 })
|
|
1955
|
+
|
|
1956
|
+
fastify.server.unref()
|
|
1957
|
+
|
|
1958
|
+
await t.test('/static/index.html', async (t) => {
|
|
1959
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1960
|
+
|
|
1961
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
1962
|
+
t.assert.ok(response.ok)
|
|
1963
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1964
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
1965
|
+
genericResponseChecks(t, response)
|
|
1966
|
+
})
|
|
1967
|
+
|
|
1968
|
+
await t.test('/static/index.html', async t => {
|
|
1969
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1970
|
+
|
|
1971
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html', {
|
|
1972
|
+
method: 'HEAD'
|
|
1973
|
+
})
|
|
1974
|
+
t.assert.ok(response.ok)
|
|
1975
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1976
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
1977
|
+
genericResponseChecks(t, response)
|
|
1978
|
+
})
|
|
1979
|
+
|
|
1980
|
+
await t.test('/static/index.css', async (t) => {
|
|
1981
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
1982
|
+
|
|
1983
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.css')
|
|
1984
|
+
t.assert.ok(response.ok)
|
|
1985
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
1986
|
+
genericResponseChecks(t, response)
|
|
1987
|
+
})
|
|
1988
|
+
|
|
1989
|
+
await t.test('/static', (t) => {
|
|
1990
|
+
t.plan(2)
|
|
1991
|
+
|
|
1992
|
+
const { promise, resolve } = Promise.withResolvers()
|
|
1993
|
+
|
|
1994
|
+
const testurl = 'http://localhost:' + fastify.server.address().port + '/static'
|
|
1995
|
+
const req = http.request(url.parse(testurl), res => {
|
|
1996
|
+
t.assert.deepStrictEqual(res.statusCode, 200)
|
|
1997
|
+
let body = ''
|
|
1998
|
+
res.on('data', (chunk) => {
|
|
1999
|
+
body += chunk.toString()
|
|
2000
|
+
})
|
|
2001
|
+
res.on('end', () => {
|
|
2002
|
+
t.assert.deepStrictEqual(JSON.parse(body.toString()), { hello: 'world' })
|
|
2003
|
+
resolve()
|
|
2004
|
+
})
|
|
2005
|
+
})
|
|
2006
|
+
req.on('error', (err) => console.error(err))
|
|
2007
|
+
req.end()
|
|
2008
|
+
|
|
2009
|
+
return promise
|
|
2010
|
+
})
|
|
2011
|
+
|
|
2012
|
+
await t.test('/static/', async (t) => {
|
|
2013
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2014
|
+
|
|
2015
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/')
|
|
2016
|
+
t.assert.ok(response.ok)
|
|
2017
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2018
|
+
t.assert.deepStrictEqual(await response.text(), foobarContent)
|
|
2019
|
+
genericResponseChecks(t, response)
|
|
2020
|
+
})
|
|
2021
|
+
|
|
2022
|
+
await t.test('/static/', async t => {
|
|
2023
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2024
|
+
|
|
2025
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/', {
|
|
2026
|
+
method: 'HEAD'
|
|
2027
|
+
})
|
|
2028
|
+
t.assert.ok(response.ok)
|
|
2029
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2030
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
2031
|
+
genericResponseChecks(t, response)
|
|
2032
|
+
})
|
|
2033
|
+
|
|
2034
|
+
await t.test('/static/not-defined', async (t) => {
|
|
2035
|
+
t.plan(3)
|
|
2036
|
+
|
|
2037
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/not-defined')
|
|
2038
|
+
t.assert.ok(response.ok)
|
|
2039
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2040
|
+
t.assert.deepStrictEqual(await response.json(), { hello: 'world' })
|
|
2041
|
+
})
|
|
2042
|
+
|
|
2043
|
+
await t.test('/static/deep/path/for/test/purpose/', async (t) => {
|
|
2044
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2045
|
+
|
|
2046
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/purpose/')
|
|
2047
|
+
t.assert.ok(response.ok)
|
|
2048
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2049
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
2050
|
+
genericResponseChecks(t, response)
|
|
2051
|
+
})
|
|
2052
|
+
|
|
2053
|
+
await t.test('/static/deep/path/for/test/', async (t) => {
|
|
2054
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2055
|
+
|
|
2056
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/')
|
|
2057
|
+
t.assert.ok(response.ok)
|
|
2058
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2059
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
2060
|
+
genericResponseChecks(t, response)
|
|
2061
|
+
})
|
|
2062
|
+
|
|
2063
|
+
await t.test('/static/../index.js', async (t) => {
|
|
2064
|
+
t.plan(3)
|
|
2065
|
+
|
|
2066
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/../index.js')
|
|
2067
|
+
t.assert.ok(response.ok)
|
|
2068
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2069
|
+
t.assert.deepStrictEqual(await response.json(), { hello: 'world' })
|
|
2070
|
+
})
|
|
2071
|
+
})
|
|
2072
|
+
|
|
2073
|
+
test('register /static with redirect true', async t => {
|
|
2074
|
+
t.plan(6)
|
|
2075
|
+
|
|
2076
|
+
const pluginOptions = {
|
|
2077
|
+
root: path.join(__dirname, '/static'),
|
|
2078
|
+
prefix: '/static',
|
|
2079
|
+
redirect: true,
|
|
2080
|
+
index: 'index.html'
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
const fastify = Fastify()
|
|
2084
|
+
|
|
2085
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2086
|
+
|
|
2087
|
+
t.after(() => fastify.close())
|
|
2088
|
+
|
|
2089
|
+
await fastify.listen({ port: 0 })
|
|
2090
|
+
|
|
2091
|
+
fastify.server.unref()
|
|
2092
|
+
|
|
2093
|
+
await t.test('/static?a=b', async (t) => {
|
|
2094
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2095
|
+
|
|
2096
|
+
const { promise, resolve } = Promise.withResolvers()
|
|
2097
|
+
|
|
2098
|
+
const testurl = 'http://localhost:' + fastify.server.address().port + '/static?a=b'
|
|
2099
|
+
const req = http.request(url.parse(testurl), res => {
|
|
2100
|
+
t.assert.deepStrictEqual(res.statusCode, 301)
|
|
2101
|
+
t.assert.deepStrictEqual(res.headers.location, '/static/?a=b')
|
|
2102
|
+
resolve()
|
|
2103
|
+
})
|
|
2104
|
+
req.on('error', (err) => console.error(err))
|
|
2105
|
+
req.end()
|
|
2106
|
+
|
|
2107
|
+
await promise
|
|
2108
|
+
|
|
2109
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static?a=b')
|
|
2110
|
+
t.assert.ok(response.ok)
|
|
2111
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2112
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
2113
|
+
genericResponseChecks(t, response)
|
|
2114
|
+
})
|
|
2115
|
+
|
|
2116
|
+
await t.test('/static', t => {
|
|
2117
|
+
t.plan(2)
|
|
2118
|
+
|
|
2119
|
+
const { promise, resolve } = Promise.withResolvers()
|
|
2120
|
+
|
|
2121
|
+
const testurl = 'http://localhost:' + fastify.server.address().port + '/static'
|
|
2122
|
+
const req = http.request(url.parse(testurl), res => {
|
|
2123
|
+
t.assert.deepStrictEqual(res.statusCode, 301)
|
|
2124
|
+
t.assert.deepStrictEqual(res.headers.location, '/static/')
|
|
2125
|
+
|
|
2126
|
+
resolve()
|
|
2127
|
+
})
|
|
2128
|
+
req.on('error', err => console.error(err))
|
|
2129
|
+
req.end()
|
|
2130
|
+
|
|
2131
|
+
return promise
|
|
2132
|
+
})
|
|
2133
|
+
|
|
2134
|
+
await t.test('/static/', async t => {
|
|
2135
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2136
|
+
|
|
2137
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/')
|
|
2138
|
+
t.assert.ok(response.ok)
|
|
2139
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2140
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
2141
|
+
genericResponseChecks(t, response)
|
|
2142
|
+
})
|
|
2143
|
+
|
|
2144
|
+
await t.test('/static/deep', async (t) => {
|
|
2145
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
2146
|
+
|
|
2147
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep')
|
|
2148
|
+
t.assert.ok(!response.ok)
|
|
2149
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
2150
|
+
genericErrorResponseChecks(t, response)
|
|
2151
|
+
})
|
|
2152
|
+
|
|
2153
|
+
await t.test('/static/deep/path/for/test?a=b', async (t) => {
|
|
2154
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2155
|
+
|
|
2156
|
+
const { promise, resolve } = Promise.withResolvers()
|
|
2157
|
+
|
|
2158
|
+
const testurl = 'http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test?a=b'
|
|
2159
|
+
const req = http.request(url.parse(testurl), res => {
|
|
2160
|
+
t.assert.deepStrictEqual(res.statusCode, 301)
|
|
2161
|
+
t.assert.deepStrictEqual(res.headers.location, '/static/deep/path/for/test/?a=b')
|
|
2162
|
+
resolve()
|
|
2163
|
+
})
|
|
2164
|
+
req.on('error', (err) => console.error(err))
|
|
2165
|
+
req.end()
|
|
2166
|
+
|
|
2167
|
+
await promise
|
|
2168
|
+
|
|
2169
|
+
// verify the redirect with query parameters works
|
|
2170
|
+
const response = await fetch(testurl)
|
|
2171
|
+
t.assert.ok(response.ok)
|
|
2172
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2173
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
2174
|
+
genericResponseChecks(t, response)
|
|
2175
|
+
})
|
|
2176
|
+
|
|
2177
|
+
await t.test('/static/deep/path/for/test', async (t) => {
|
|
2178
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2179
|
+
|
|
2180
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test')
|
|
2181
|
+
t.assert.ok(response.ok)
|
|
2182
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2183
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
2184
|
+
genericResponseChecks(t, response)
|
|
2185
|
+
})
|
|
2186
|
+
})
|
|
2187
|
+
|
|
2188
|
+
test('register /static with redirect true and wildcard false', async t => {
|
|
2189
|
+
t.plan(7)
|
|
2190
|
+
|
|
2191
|
+
const pluginOptions = {
|
|
2192
|
+
root: path.join(__dirname, '/static'),
|
|
2193
|
+
prefix: '/static',
|
|
2194
|
+
redirect: true,
|
|
2195
|
+
wildcard: false,
|
|
2196
|
+
index: 'index.html'
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
const fastify = Fastify()
|
|
2200
|
+
|
|
2201
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2202
|
+
|
|
2203
|
+
t.after(() => fastify.close())
|
|
2204
|
+
|
|
2205
|
+
await fastify.listen({ port: 0 })
|
|
2206
|
+
|
|
2207
|
+
fastify.server.unref()
|
|
2208
|
+
|
|
2209
|
+
await t.test('/static?a=b', async t => {
|
|
2210
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2211
|
+
|
|
2212
|
+
const { promise, resolve } = Promise.withResolvers()
|
|
2213
|
+
|
|
2214
|
+
const testurl = 'http://localhost:' + fastify.server.address().port + '/static?a=b'
|
|
2215
|
+
const req = http.request(url.parse(testurl), res => {
|
|
2216
|
+
t.assert.deepStrictEqual(res.statusCode, 301)
|
|
2217
|
+
t.assert.deepStrictEqual(res.headers.location, '/static/?a=b')
|
|
2218
|
+
resolve()
|
|
2219
|
+
})
|
|
2220
|
+
req.on('error', err => console.error(err))
|
|
2221
|
+
req.end()
|
|
2222
|
+
await promise
|
|
2223
|
+
|
|
2224
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static?a=b')
|
|
2225
|
+
t.assert.ok(response.ok)
|
|
2226
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2227
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
2228
|
+
genericResponseChecks(t, response)
|
|
2229
|
+
})
|
|
2230
|
+
|
|
2231
|
+
await t.test('/static/?a=b', async t => {
|
|
2232
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2233
|
+
|
|
2234
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/?a=b')
|
|
2235
|
+
t.assert.ok(response.ok)
|
|
2236
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2237
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
2238
|
+
genericResponseChecks(t, response)
|
|
2239
|
+
})
|
|
2240
|
+
|
|
2241
|
+
await t.test('/static/?a=b - HEAD', async t => {
|
|
2242
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2243
|
+
|
|
2244
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/?a=b', { method: 'HEAD' })
|
|
2245
|
+
t.assert.ok(response.ok)
|
|
2246
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2247
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
2248
|
+
genericResponseChecks(t, response)
|
|
2249
|
+
})
|
|
2250
|
+
|
|
2251
|
+
await t.test('/static/deep', async t => {
|
|
2252
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
2253
|
+
|
|
2254
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep')
|
|
2255
|
+
t.assert.ok(!response.ok)
|
|
2256
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
2257
|
+
genericErrorResponseChecks(t, response)
|
|
2258
|
+
})
|
|
2259
|
+
|
|
2260
|
+
await t.test('/static/deep/path/for/test?a=b', async t => {
|
|
2261
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2262
|
+
|
|
2263
|
+
const { promise, resolve } = Promise.withResolvers()
|
|
2264
|
+
|
|
2265
|
+
const testurl = 'http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test?a=b'
|
|
2266
|
+
const req = http.request(url.parse(testurl), res => {
|
|
2267
|
+
t.assert.deepStrictEqual(res.statusCode, 301)
|
|
2268
|
+
t.assert.deepStrictEqual(res.headers.location, '/static/deep/path/for/test/?a=b')
|
|
2269
|
+
resolve()
|
|
2270
|
+
})
|
|
2271
|
+
req.on('error', err => console.error(err))
|
|
2272
|
+
req.end()
|
|
2273
|
+
await promise
|
|
2274
|
+
|
|
2275
|
+
const response = await fetch(testurl)
|
|
2276
|
+
t.assert.ok(response.ok)
|
|
2277
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2278
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
2279
|
+
genericResponseChecks(t, response)
|
|
2280
|
+
})
|
|
2281
|
+
|
|
2282
|
+
await t.test('/static/deep/path/for/test', async t => {
|
|
2283
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2284
|
+
|
|
2285
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test')
|
|
2286
|
+
t.assert.ok(response.ok)
|
|
2287
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2288
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
2289
|
+
genericResponseChecks(t, response)
|
|
2290
|
+
})
|
|
2291
|
+
|
|
2292
|
+
await t.test('/static/deep/path/for/test', async t => {
|
|
2293
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2294
|
+
|
|
2295
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test', { method: 'HEAD' })
|
|
2296
|
+
t.assert.ok(response.ok)
|
|
2297
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2298
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
2299
|
+
genericResponseChecks(t, response)
|
|
2300
|
+
})
|
|
2301
|
+
})
|
|
2302
|
+
|
|
2303
|
+
test('trailing slash behavior with redirect = false', async (t) => {
|
|
2304
|
+
t.plan(5)
|
|
2305
|
+
|
|
2306
|
+
const fastify = Fastify()
|
|
2307
|
+
fastify.register(fastifyStatic, {
|
|
2308
|
+
root: path.join(__dirname, '/static'),
|
|
2309
|
+
prefix: '/static',
|
|
2310
|
+
redirect: false
|
|
2311
|
+
})
|
|
2312
|
+
fastify.server.unref()
|
|
2313
|
+
|
|
2314
|
+
t.after(() => fastify.close())
|
|
2315
|
+
|
|
2316
|
+
await fastify.listen({ port: 0 })
|
|
2317
|
+
|
|
2318
|
+
fastify.server.unref()
|
|
2319
|
+
|
|
2320
|
+
const host = 'http://localhost:' + fastify.server.address().port
|
|
2321
|
+
|
|
2322
|
+
await t.test('prefix with no trailing slash => 404', async (t) => {
|
|
2323
|
+
t.plan(2)
|
|
2324
|
+
|
|
2325
|
+
const response = await fetch(host + '/static')
|
|
2326
|
+
t.assert.ok(!response.ok)
|
|
2327
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
2328
|
+
})
|
|
2329
|
+
|
|
2330
|
+
await t.test('prefix with trailing trailing slash => 200', async (t) => {
|
|
2331
|
+
t.plan(2)
|
|
2332
|
+
|
|
2333
|
+
const response = await fetch(host + '/static/')
|
|
2334
|
+
t.assert.ok(response.ok)
|
|
2335
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2336
|
+
})
|
|
2337
|
+
|
|
2338
|
+
await t.test('deep path with no index.html or trailing slash => 404', async (t) => {
|
|
2339
|
+
t.plan(2)
|
|
2340
|
+
|
|
2341
|
+
const response = await fetch(host + '/static/deep/path')
|
|
2342
|
+
t.assert.ok(!response.ok)
|
|
2343
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
2344
|
+
})
|
|
2345
|
+
|
|
2346
|
+
await t.test('deep path with index.html but no trailing slash => 200', async (t) => {
|
|
2347
|
+
t.plan(2)
|
|
2348
|
+
|
|
2349
|
+
const response = await fetch(host + '/static/deep/path/for/test')
|
|
2350
|
+
t.assert.ok(response.ok)
|
|
2351
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2352
|
+
})
|
|
2353
|
+
|
|
2354
|
+
await t.test('deep path with index.html and trailing slash => 200', async (t) => {
|
|
2355
|
+
t.plan(2)
|
|
2356
|
+
|
|
2357
|
+
const response = await fetch(host + '/static/deep/path/for/test/')
|
|
2358
|
+
t.assert.ok(response.ok)
|
|
2359
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2360
|
+
})
|
|
2361
|
+
})
|
|
2362
|
+
|
|
2363
|
+
test('if dotfiles are properly served according to plugin options', async (t) => {
|
|
2364
|
+
t.plan(3)
|
|
2365
|
+
const exampleContents = fs
|
|
2366
|
+
.readFileSync(path.join(__dirname, 'static', '.example'), {
|
|
2367
|
+
encoding: 'utf8'
|
|
2368
|
+
})
|
|
2369
|
+
.toString()
|
|
2370
|
+
|
|
2371
|
+
await t.test('freely serve dotfiles', async (t) => {
|
|
2372
|
+
t.plan(3)
|
|
2373
|
+
const fastify = Fastify()
|
|
2374
|
+
|
|
2375
|
+
const pluginOptions = {
|
|
2376
|
+
root: path.join(__dirname, 'static'),
|
|
2377
|
+
prefix: '/static/',
|
|
2378
|
+
dotfiles: 'allow'
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2382
|
+
|
|
2383
|
+
t.after(() => fastify.close())
|
|
2384
|
+
|
|
2385
|
+
await fastify.listen({ port: 0 })
|
|
2386
|
+
fastify.server.unref()
|
|
2387
|
+
|
|
2388
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/.example')
|
|
2389
|
+
t.assert.ok(response.ok)
|
|
2390
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2391
|
+
t.assert.deepStrictEqual(await response.text(), exampleContents)
|
|
2392
|
+
})
|
|
2393
|
+
|
|
2394
|
+
await t.test('ignore dotfiles', async (t) => {
|
|
2395
|
+
t.plan(2)
|
|
2396
|
+
const fastify = Fastify()
|
|
2397
|
+
|
|
2398
|
+
const pluginOptions = {
|
|
2399
|
+
root: path.join(__dirname, 'static'),
|
|
2400
|
+
prefix: '/static/',
|
|
2401
|
+
dotfiles: 'ignore'
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2405
|
+
|
|
2406
|
+
t.after(() => fastify.close())
|
|
2407
|
+
|
|
2408
|
+
await fastify.listen({ port: 0 })
|
|
2409
|
+
fastify.server.unref()
|
|
2410
|
+
|
|
2411
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/.example')
|
|
2412
|
+
t.assert.ok(!response.ok)
|
|
2413
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
2414
|
+
})
|
|
2415
|
+
|
|
2416
|
+
await t.test('deny requests to serve a dotfile', async (t) => {
|
|
2417
|
+
t.plan(2)
|
|
2418
|
+
const fastify = Fastify()
|
|
2419
|
+
|
|
2420
|
+
const pluginOptions = {
|
|
2421
|
+
root: path.join(__dirname, 'static'),
|
|
2422
|
+
prefix: '/static/',
|
|
2423
|
+
dotfiles: 'deny'
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2427
|
+
|
|
2428
|
+
t.after(() => fastify.close())
|
|
2429
|
+
await fastify.listen({ port: 0 })
|
|
2430
|
+
fastify.server.unref()
|
|
2431
|
+
|
|
2432
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/.example')
|
|
2433
|
+
t.assert.ok(!response.ok)
|
|
2434
|
+
t.assert.deepStrictEqual(response.status, 403)
|
|
2435
|
+
})
|
|
2436
|
+
})
|
|
2437
|
+
|
|
2438
|
+
test('register with failing glob handler', async (t) => {
|
|
2439
|
+
const fastifyStatic = proxyquire.noCallThru()('../', {
|
|
2440
|
+
glob: function globStub (_pattern, _options, cb) {
|
|
2441
|
+
process.nextTick(function () {
|
|
2442
|
+
return cb(new Error('mock glob error'))
|
|
2443
|
+
})
|
|
2444
|
+
}
|
|
2445
|
+
})
|
|
2446
|
+
|
|
2447
|
+
const pluginOptions = {
|
|
2448
|
+
root: path.join(__dirname, '/static'),
|
|
2449
|
+
serve: true,
|
|
2450
|
+
wildcard: false
|
|
2451
|
+
}
|
|
2452
|
+
const fastify = Fastify()
|
|
2453
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2454
|
+
|
|
2455
|
+
t.after(() => fastify.close())
|
|
2456
|
+
|
|
2457
|
+
await t.assert.rejects(fastify.listen({ port: 0 }))
|
|
2458
|
+
})
|
|
2459
|
+
|
|
2460
|
+
test(
|
|
2461
|
+
'register with rootpath that causes statSync to fail with non-ENOENT code',
|
|
2462
|
+
async (t) => {
|
|
2463
|
+
const fastifyStatic = proxyquire('../', {
|
|
2464
|
+
'node:fs': {
|
|
2465
|
+
statSync: function statSyncStub () {
|
|
2466
|
+
throw new Error({ code: 'MOCK' })
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
})
|
|
2470
|
+
|
|
2471
|
+
const pluginOptions = {
|
|
2472
|
+
root: path.join(__dirname, '/static'),
|
|
2473
|
+
wildcard: true
|
|
2474
|
+
}
|
|
2475
|
+
const fastify = Fastify()
|
|
2476
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2477
|
+
|
|
2478
|
+
t.after(() => fastify.close())
|
|
2479
|
+
|
|
2480
|
+
await t.assert.rejects(fastify.listen({ port: 0 }))
|
|
2481
|
+
}
|
|
2482
|
+
)
|
|
2483
|
+
|
|
2484
|
+
test('inject support', async (t) => {
|
|
2485
|
+
const pluginOptions = {
|
|
2486
|
+
root: path.join(__dirname, '/static'),
|
|
2487
|
+
prefix: '/static'
|
|
2488
|
+
}
|
|
2489
|
+
const fastify = Fastify()
|
|
2490
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2491
|
+
t.after(() => fastify.close())
|
|
2492
|
+
|
|
2493
|
+
const response = await fastify.inject({
|
|
2494
|
+
method: 'GET',
|
|
2495
|
+
url: '/static/index.html'
|
|
2496
|
+
})
|
|
2497
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2498
|
+
t.assert.deepStrictEqual(response.body.toString(), indexContent)
|
|
2499
|
+
})
|
|
2500
|
+
|
|
2501
|
+
test('routes should use custom errorHandler premature stream close', async t => {
|
|
2502
|
+
t.plan(2)
|
|
2503
|
+
|
|
2504
|
+
const pluginOptions = {
|
|
2505
|
+
root: path.join(__dirname, '/static'),
|
|
2506
|
+
prefix: '/static/'
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
const fastify = Fastify()
|
|
2510
|
+
|
|
2511
|
+
fastify.addHook('onRoute', function (routeOptions) {
|
|
2512
|
+
t.assert.ok(routeOptions.errorHandler instanceof Function)
|
|
2513
|
+
|
|
2514
|
+
routeOptions.onRequest = (_request, _reply, done) => {
|
|
2515
|
+
const fakeError = new Error()
|
|
2516
|
+
fakeError.code = 'ERR_STREAM_PREMATURE_CLOSE'
|
|
2517
|
+
done(fakeError)
|
|
2518
|
+
}
|
|
2519
|
+
})
|
|
2520
|
+
|
|
2521
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2522
|
+
t.after(() => fastify.close())
|
|
2523
|
+
|
|
2524
|
+
await t.assert.rejects(fastify.inject({ method: 'GET', url: '/static/index.html' }))
|
|
2525
|
+
})
|
|
2526
|
+
|
|
2527
|
+
test('routes should fallback to default errorHandler', async t => {
|
|
2528
|
+
t.plan(3)
|
|
2529
|
+
|
|
2530
|
+
const pluginOptions = {
|
|
2531
|
+
root: path.join(__dirname, '/static'),
|
|
2532
|
+
prefix: '/static/'
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
const fastify = Fastify()
|
|
2536
|
+
|
|
2537
|
+
fastify.addHook('onRoute', function (routeOptions) {
|
|
2538
|
+
t.assert.ok(routeOptions.errorHandler instanceof Function)
|
|
2539
|
+
|
|
2540
|
+
routeOptions.preHandler = (_request, _reply, done) => {
|
|
2541
|
+
const fakeError = new Error()
|
|
2542
|
+
fakeError.code = 'SOMETHING_ELSE'
|
|
2543
|
+
done(fakeError)
|
|
2544
|
+
}
|
|
2545
|
+
})
|
|
2546
|
+
|
|
2547
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2548
|
+
t.after(() => fastify.close())
|
|
2549
|
+
|
|
2550
|
+
const response = await fastify.inject({ method: 'GET', url: '/static/index.html' })
|
|
2551
|
+
t.assert.deepStrictEqual(response.statusCode, 500)
|
|
2552
|
+
t.assert.deepStrictEqual(await response.json(), {
|
|
2553
|
+
statusCode: 500,
|
|
2554
|
+
code: 'SOMETHING_ELSE',
|
|
2555
|
+
error: 'Internal Server Error',
|
|
2556
|
+
message: ''
|
|
2557
|
+
})
|
|
2558
|
+
})
|
|
2559
|
+
|
|
2560
|
+
test('percent encoded URLs in glob mode', async (t) => {
|
|
2561
|
+
t.plan(3)
|
|
2562
|
+
|
|
2563
|
+
const fastify = Fastify({})
|
|
2564
|
+
|
|
2565
|
+
fastify.register(fastifyStatic, {
|
|
2566
|
+
root: path.join(__dirname, 'static'),
|
|
2567
|
+
prefix: '/static',
|
|
2568
|
+
wildcard: true
|
|
2569
|
+
})
|
|
2570
|
+
|
|
2571
|
+
t.after(() => fastify.close())
|
|
2572
|
+
|
|
2573
|
+
await fastify.listen({ port: 0 })
|
|
2574
|
+
fastify.server.unref()
|
|
2575
|
+
|
|
2576
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/a .md')
|
|
2577
|
+
t.assert.ok(response.ok)
|
|
2578
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2579
|
+
t.assert.deepStrictEqual(
|
|
2580
|
+
fs.readFileSync(path.join(__dirname, 'static', 'a .md'), 'utf-8'),
|
|
2581
|
+
await response.text()
|
|
2582
|
+
)
|
|
2583
|
+
})
|
|
2584
|
+
|
|
2585
|
+
test('register /static and /static2 without wildcard', async t => {
|
|
2586
|
+
t.plan(2)
|
|
2587
|
+
|
|
2588
|
+
const pluginOptions = {
|
|
2589
|
+
root: [path.join(__dirname, '/static'), path.join(__dirname, '/static2')],
|
|
2590
|
+
wildcard: false
|
|
2591
|
+
}
|
|
2592
|
+
const fastify = Fastify()
|
|
2593
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2594
|
+
|
|
2595
|
+
t.after(() => fastify.close())
|
|
2596
|
+
|
|
2597
|
+
await fastify.listen({ port: 0 })
|
|
2598
|
+
fastify.server.unref()
|
|
2599
|
+
|
|
2600
|
+
await t.test('/index.html', async t => {
|
|
2601
|
+
t.plan(4 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2602
|
+
|
|
2603
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html')
|
|
2604
|
+
t.assert.ok(response.ok)
|
|
2605
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2606
|
+
const responseContent = await response.text()
|
|
2607
|
+
t.assert.notDeepStrictEqual(responseContent, index2Content)
|
|
2608
|
+
t.assert.deepStrictEqual(responseContent, indexContent)
|
|
2609
|
+
genericResponseChecks(t, response)
|
|
2610
|
+
})
|
|
2611
|
+
|
|
2612
|
+
await t.test('/static/bar.html', async t => {
|
|
2613
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
2614
|
+
|
|
2615
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/bar.html')
|
|
2616
|
+
t.assert.ok(response.ok)
|
|
2617
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
2618
|
+
t.assert.deepStrictEqual(await response.text(), barContent)
|
|
2619
|
+
genericResponseChecks(t, response)
|
|
2620
|
+
})
|
|
2621
|
+
})
|
|
2622
|
+
|
|
2623
|
+
test(
|
|
2624
|
+
'will serve pre-compressed files with .br at the highest priority',
|
|
2625
|
+
async (t) => {
|
|
2626
|
+
const pluginOptions = {
|
|
2627
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2628
|
+
prefix: '/static-pre-compressed/',
|
|
2629
|
+
preCompressed: true
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
const fastify = Fastify()
|
|
2633
|
+
|
|
2634
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2635
|
+
t.after(() => fastify.close())
|
|
2636
|
+
|
|
2637
|
+
const response = await fastify.inject({
|
|
2638
|
+
method: 'GET',
|
|
2639
|
+
url: '/static-pre-compressed/all-three.html',
|
|
2640
|
+
headers: {
|
|
2641
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
2642
|
+
}
|
|
2643
|
+
})
|
|
2644
|
+
|
|
2645
|
+
genericResponseChecks(t, response)
|
|
2646
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'br')
|
|
2647
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2648
|
+
t.assert.deepStrictEqual(response.rawPayload, allThreeBr)
|
|
2649
|
+
}
|
|
2650
|
+
)
|
|
2651
|
+
|
|
2652
|
+
test(
|
|
2653
|
+
'will serve pre-compressed files and fallback to .gz if .br is not on disk',
|
|
2654
|
+
async (t) => {
|
|
2655
|
+
const pluginOptions = {
|
|
2656
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2657
|
+
prefix: '/static-pre-compressed/',
|
|
2658
|
+
preCompressed: true
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
const fastify = Fastify()
|
|
2662
|
+
|
|
2663
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2664
|
+
t.after(() => fastify.close())
|
|
2665
|
+
|
|
2666
|
+
const response = await fastify.inject({
|
|
2667
|
+
method: 'GET',
|
|
2668
|
+
url: '/static-pre-compressed/gzip-only.html',
|
|
2669
|
+
headers: {
|
|
2670
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
2671
|
+
}
|
|
2672
|
+
})
|
|
2673
|
+
|
|
2674
|
+
genericResponseChecks(t, response)
|
|
2675
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'gzip')
|
|
2676
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2677
|
+
t.assert.deepStrictEqual(response.rawPayload, gzipOnly)
|
|
2678
|
+
}
|
|
2679
|
+
)
|
|
2680
|
+
|
|
2681
|
+
test(
|
|
2682
|
+
'will serve pre-compressed files with .gzip if * directive used',
|
|
2683
|
+
async (t) => {
|
|
2684
|
+
const pluginOptions = {
|
|
2685
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2686
|
+
prefix: '/static-pre-compressed/',
|
|
2687
|
+
preCompressed: true
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
const fastify = Fastify()
|
|
2691
|
+
|
|
2692
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2693
|
+
t.after(() => fastify.close())
|
|
2694
|
+
|
|
2695
|
+
const response = await fastify.inject({
|
|
2696
|
+
method: 'GET',
|
|
2697
|
+
url: '/static-pre-compressed/all-three.html',
|
|
2698
|
+
headers: {
|
|
2699
|
+
'accept-encoding': '*'
|
|
2700
|
+
}
|
|
2701
|
+
})
|
|
2702
|
+
|
|
2703
|
+
genericResponseChecks(t, response)
|
|
2704
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'gzip')
|
|
2705
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2706
|
+
t.assert.deepStrictEqual(response.rawPayload, allThreeGzip)
|
|
2707
|
+
}
|
|
2708
|
+
)
|
|
2709
|
+
|
|
2710
|
+
test(
|
|
2711
|
+
'will serve pre-compressed files with .gzip if multiple * directives used',
|
|
2712
|
+
async (t) => {
|
|
2713
|
+
const pluginOptions = {
|
|
2714
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2715
|
+
prefix: '/static-pre-compressed/',
|
|
2716
|
+
preCompressed: true
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
const fastify = Fastify()
|
|
2720
|
+
|
|
2721
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2722
|
+
t.after(() => fastify.close())
|
|
2723
|
+
|
|
2724
|
+
const response = await fastify.inject({
|
|
2725
|
+
method: 'GET',
|
|
2726
|
+
url: '/static-pre-compressed/all-three.html',
|
|
2727
|
+
headers: {
|
|
2728
|
+
'accept-encoding': '*, *'
|
|
2729
|
+
}
|
|
2730
|
+
})
|
|
2731
|
+
|
|
2732
|
+
genericResponseChecks(t, response)
|
|
2733
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'gzip')
|
|
2734
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2735
|
+
t.assert.deepStrictEqual(response.rawPayload, allThreeGzip)
|
|
2736
|
+
}
|
|
2737
|
+
)
|
|
2738
|
+
|
|
2739
|
+
test(
|
|
2740
|
+
'will serve uncompressed files if there are no compressed variants on disk',
|
|
2741
|
+
async (t) => {
|
|
2742
|
+
const pluginOptions = {
|
|
2743
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2744
|
+
prefix: '/static-pre-compressed/',
|
|
2745
|
+
preCompressed: true
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
const fastify = Fastify()
|
|
2749
|
+
|
|
2750
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2751
|
+
t.after(() => fastify.close())
|
|
2752
|
+
|
|
2753
|
+
const response = await fastify.inject({
|
|
2754
|
+
method: 'GET',
|
|
2755
|
+
url: '/static-pre-compressed/uncompressed.html',
|
|
2756
|
+
headers: {
|
|
2757
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
2758
|
+
}
|
|
2759
|
+
})
|
|
2760
|
+
|
|
2761
|
+
genericResponseChecks(t, response)
|
|
2762
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], undefined)
|
|
2763
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2764
|
+
t.assert.deepStrictEqual(response.body, uncompressedStatic)
|
|
2765
|
+
}
|
|
2766
|
+
)
|
|
2767
|
+
|
|
2768
|
+
test(
|
|
2769
|
+
'will serve pre-compressed files with .br at the highest priority (with wildcard: false)',
|
|
2770
|
+
async (t) => {
|
|
2771
|
+
const pluginOptions = {
|
|
2772
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2773
|
+
prefix: '/static-pre-compressed/',
|
|
2774
|
+
preCompressed: true,
|
|
2775
|
+
wildcard: false
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
const fastify = Fastify()
|
|
2779
|
+
|
|
2780
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2781
|
+
t.after(() => fastify.close())
|
|
2782
|
+
|
|
2783
|
+
const response = await fastify.inject({
|
|
2784
|
+
method: 'GET',
|
|
2785
|
+
url: '/static-pre-compressed/all-three.html',
|
|
2786
|
+
headers: {
|
|
2787
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
2788
|
+
}
|
|
2789
|
+
})
|
|
2790
|
+
|
|
2791
|
+
genericResponseChecks(t, response)
|
|
2792
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'br')
|
|
2793
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2794
|
+
t.assert.deepStrictEqual(response.rawPayload, allThreeBr)
|
|
2795
|
+
}
|
|
2796
|
+
)
|
|
2797
|
+
|
|
2798
|
+
test(
|
|
2799
|
+
'will serve pre-compressed files and fallback to .gz if .br is not on disk (with wildcard: false)',
|
|
2800
|
+
async (t) => {
|
|
2801
|
+
const pluginOptions = {
|
|
2802
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2803
|
+
prefix: '/static-pre-compressed/',
|
|
2804
|
+
preCompressed: true,
|
|
2805
|
+
wildcard: false
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2808
|
+
const fastify = Fastify()
|
|
2809
|
+
|
|
2810
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2811
|
+
t.after(() => fastify.close())
|
|
2812
|
+
|
|
2813
|
+
const response = await fastify.inject({
|
|
2814
|
+
method: 'GET',
|
|
2815
|
+
url: '/static-pre-compressed/gzip-only.html',
|
|
2816
|
+
headers: {
|
|
2817
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
2818
|
+
}
|
|
2819
|
+
})
|
|
2820
|
+
|
|
2821
|
+
genericResponseChecks(t, response)
|
|
2822
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'gzip')
|
|
2823
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2824
|
+
t.assert.deepStrictEqual(response.rawPayload, gzipOnly)
|
|
2825
|
+
}
|
|
2826
|
+
)
|
|
2827
|
+
|
|
2828
|
+
test(
|
|
2829
|
+
'will serve pre-compressed files with .gzip if * directive used (with wildcard: false)',
|
|
2830
|
+
async (t) => {
|
|
2831
|
+
const pluginOptions = {
|
|
2832
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2833
|
+
prefix: '/static-pre-compressed/',
|
|
2834
|
+
preCompressed: true,
|
|
2835
|
+
wildcard: false
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
const fastify = Fastify()
|
|
2839
|
+
|
|
2840
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2841
|
+
t.after(() => fastify.close())
|
|
2842
|
+
|
|
2843
|
+
const response = await fastify.inject({
|
|
2844
|
+
method: 'GET',
|
|
2845
|
+
url: '/static-pre-compressed/all-three.html',
|
|
2846
|
+
headers: {
|
|
2847
|
+
'accept-encoding': '*'
|
|
2848
|
+
}
|
|
2849
|
+
})
|
|
2850
|
+
|
|
2851
|
+
genericResponseChecks(t, response)
|
|
2852
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'gzip')
|
|
2853
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2854
|
+
t.assert.deepStrictEqual(response.rawPayload, allThreeGzip)
|
|
2855
|
+
}
|
|
2856
|
+
)
|
|
2857
|
+
|
|
2858
|
+
test(
|
|
2859
|
+
'will serve pre-compressed files with .gzip if multiple * directives used (with wildcard: false)',
|
|
2860
|
+
async (t) => {
|
|
2861
|
+
const pluginOptions = {
|
|
2862
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2863
|
+
prefix: '/static-pre-compressed/',
|
|
2864
|
+
preCompressed: true,
|
|
2865
|
+
wildcard: false
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2868
|
+
const fastify = Fastify()
|
|
2869
|
+
|
|
2870
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2871
|
+
t.after(() => fastify.close())
|
|
2872
|
+
|
|
2873
|
+
const response = await fastify.inject({
|
|
2874
|
+
method: 'GET',
|
|
2875
|
+
url: '/static-pre-compressed/all-three.html',
|
|
2876
|
+
headers: {
|
|
2877
|
+
'accept-encoding': '*, *'
|
|
2878
|
+
}
|
|
2879
|
+
})
|
|
2880
|
+
|
|
2881
|
+
genericResponseChecks(t, response)
|
|
2882
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'gzip')
|
|
2883
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2884
|
+
t.assert.deepStrictEqual(response.rawPayload, allThreeGzip)
|
|
2885
|
+
}
|
|
2886
|
+
)
|
|
2887
|
+
|
|
2888
|
+
test(
|
|
2889
|
+
'will serve uncompressed files if there are no compressed variants on disk (with wildcard: false)',
|
|
2890
|
+
async (t) => {
|
|
2891
|
+
const pluginOptions = {
|
|
2892
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2893
|
+
prefix: '/static-pre-compressed/',
|
|
2894
|
+
preCompressed: true,
|
|
2895
|
+
wildcard: false
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
const fastify = Fastify()
|
|
2899
|
+
|
|
2900
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2901
|
+
t.after(() => fastify.close())
|
|
2902
|
+
|
|
2903
|
+
const response = await fastify.inject({
|
|
2904
|
+
method: 'GET',
|
|
2905
|
+
url: '/static-pre-compressed/uncompressed.html',
|
|
2906
|
+
headers: {
|
|
2907
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
2908
|
+
}
|
|
2909
|
+
})
|
|
2910
|
+
|
|
2911
|
+
genericResponseChecks(t, response)
|
|
2912
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], undefined)
|
|
2913
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2914
|
+
t.assert.deepStrictEqual(response.body, uncompressedStatic)
|
|
2915
|
+
}
|
|
2916
|
+
)
|
|
2917
|
+
|
|
2918
|
+
test(
|
|
2919
|
+
'will serve uncompressed files the accept-encoding header is missing',
|
|
2920
|
+
async (t) => {
|
|
2921
|
+
const pluginOptions = {
|
|
2922
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2923
|
+
prefix: '/static-pre-compressed/',
|
|
2924
|
+
preCompressed: true
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
const fastify = Fastify()
|
|
2928
|
+
|
|
2929
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2930
|
+
t.after(() => fastify.close())
|
|
2931
|
+
|
|
2932
|
+
const response = await fastify.inject({
|
|
2933
|
+
method: 'GET',
|
|
2934
|
+
url: '/static-pre-compressed/uncompressed.html'
|
|
2935
|
+
})
|
|
2936
|
+
|
|
2937
|
+
genericResponseChecks(t, response)
|
|
2938
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], undefined)
|
|
2939
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2940
|
+
t.assert.deepStrictEqual(response.body, uncompressedStatic)
|
|
2941
|
+
}
|
|
2942
|
+
)
|
|
2943
|
+
|
|
2944
|
+
test(
|
|
2945
|
+
'will serve precompressed index',
|
|
2946
|
+
async (t) => {
|
|
2947
|
+
const pluginOptions = {
|
|
2948
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2949
|
+
prefix: '/static-pre-compressed/',
|
|
2950
|
+
preCompressed: true
|
|
2951
|
+
}
|
|
2952
|
+
|
|
2953
|
+
const fastify = Fastify()
|
|
2954
|
+
|
|
2955
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2956
|
+
t.after(() => fastify.close())
|
|
2957
|
+
|
|
2958
|
+
const response = await fastify.inject({
|
|
2959
|
+
method: 'GET',
|
|
2960
|
+
url: '/static-pre-compressed/',
|
|
2961
|
+
headers: {
|
|
2962
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
2963
|
+
}
|
|
2964
|
+
})
|
|
2965
|
+
|
|
2966
|
+
genericResponseChecks(t, response)
|
|
2967
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'br')
|
|
2968
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2969
|
+
t.assert.deepStrictEqual(response.rawPayload, indexBr)
|
|
2970
|
+
}
|
|
2971
|
+
)
|
|
2972
|
+
|
|
2973
|
+
test(
|
|
2974
|
+
'will serve preCompressed index without trailing slash',
|
|
2975
|
+
async (t) => {
|
|
2976
|
+
const pluginOptions = {
|
|
2977
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
2978
|
+
prefix: '/static-pre-compressed/',
|
|
2979
|
+
preCompressed: true,
|
|
2980
|
+
redirect: false
|
|
2981
|
+
}
|
|
2982
|
+
|
|
2983
|
+
const fastify = Fastify()
|
|
2984
|
+
|
|
2985
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
2986
|
+
t.after(() => fastify.close())
|
|
2987
|
+
|
|
2988
|
+
const response = await fastify.inject({
|
|
2989
|
+
method: 'GET',
|
|
2990
|
+
url: '/static-pre-compressed/dir',
|
|
2991
|
+
headers: {
|
|
2992
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
2993
|
+
}
|
|
2994
|
+
})
|
|
2995
|
+
|
|
2996
|
+
genericResponseChecks(t, response)
|
|
2997
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'br')
|
|
2998
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
2999
|
+
t.assert.deepStrictEqual(response.rawPayload, dirIndexBr)
|
|
3000
|
+
}
|
|
3001
|
+
)
|
|
3002
|
+
|
|
3003
|
+
test(
|
|
3004
|
+
'will redirect to preCompressed index without trailing slash when redirect is true',
|
|
3005
|
+
async (t) => {
|
|
3006
|
+
const pluginOptions = {
|
|
3007
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
3008
|
+
prefix: '/static-pre-compressed/',
|
|
3009
|
+
preCompressed: true,
|
|
3010
|
+
redirect: true,
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
const fastify = Fastify()
|
|
3014
|
+
|
|
3015
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3016
|
+
t.after(() => fastify.close())
|
|
3017
|
+
|
|
3018
|
+
const response = await fastify.inject({
|
|
3019
|
+
method: 'GET',
|
|
3020
|
+
url: '/static-pre-compressed/dir',
|
|
3021
|
+
headers: {
|
|
3022
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
3023
|
+
}
|
|
3024
|
+
})
|
|
3025
|
+
|
|
3026
|
+
t.assert.deepStrictEqual(response.statusCode, 301)
|
|
3027
|
+
t.assert.deepStrictEqual(response.headers.location, '/static-pre-compressed/dir/')
|
|
3028
|
+
}
|
|
3029
|
+
)
|
|
3030
|
+
|
|
3031
|
+
test(
|
|
3032
|
+
'will serve precompressed gzip index in subdir',
|
|
3033
|
+
async (t) => {
|
|
3034
|
+
const pluginOptions = {
|
|
3035
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
3036
|
+
preCompressed: true
|
|
3037
|
+
}
|
|
3038
|
+
|
|
3039
|
+
const fastify = Fastify()
|
|
3040
|
+
|
|
3041
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3042
|
+
t.after(() => fastify.close())
|
|
3043
|
+
|
|
3044
|
+
const response = await fastify.inject({
|
|
3045
|
+
method: 'GET',
|
|
3046
|
+
url: '/dir-gz',
|
|
3047
|
+
headers: {
|
|
3048
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
3049
|
+
}
|
|
3050
|
+
})
|
|
3051
|
+
|
|
3052
|
+
genericResponseChecks(t, response)
|
|
3053
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'gzip')
|
|
3054
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3055
|
+
t.assert.deepStrictEqual(response.rawPayload, dirIndexGz)
|
|
3056
|
+
}
|
|
3057
|
+
)
|
|
3058
|
+
|
|
3059
|
+
test(
|
|
3060
|
+
'will serve precompressed index with alternative index option',
|
|
3061
|
+
async (t) => {
|
|
3062
|
+
const pluginOptions = {
|
|
3063
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
3064
|
+
prefix: '/static-pre-compressed/',
|
|
3065
|
+
preCompressed: true,
|
|
3066
|
+
index: ['all-three.html']
|
|
3067
|
+
}
|
|
3068
|
+
|
|
3069
|
+
const fastify = Fastify()
|
|
3070
|
+
|
|
3071
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3072
|
+
t.after(() => fastify.close())
|
|
3073
|
+
|
|
3074
|
+
const response = await fastify.inject({
|
|
3075
|
+
method: 'GET',
|
|
3076
|
+
url: '/static-pre-compressed/',
|
|
3077
|
+
headers: {
|
|
3078
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
3079
|
+
}
|
|
3080
|
+
})
|
|
3081
|
+
|
|
3082
|
+
genericResponseChecks(t, response)
|
|
3083
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'br')
|
|
3084
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3085
|
+
t.assert.deepStrictEqual(response.rawPayload, allThreeBr)
|
|
3086
|
+
}
|
|
3087
|
+
)
|
|
3088
|
+
|
|
3089
|
+
test(
|
|
3090
|
+
'will serve precompressed file without content-type charset',
|
|
3091
|
+
async (t) => {
|
|
3092
|
+
const pluginOptions = {
|
|
3093
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
3094
|
+
prefix: '/static-pre-compressed/',
|
|
3095
|
+
preCompressed: true
|
|
3096
|
+
}
|
|
3097
|
+
|
|
3098
|
+
const fastify = Fastify()
|
|
3099
|
+
|
|
3100
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3101
|
+
t.after(() => fastify.close())
|
|
3102
|
+
|
|
3103
|
+
const response = await fastify.inject({
|
|
3104
|
+
method: 'GET',
|
|
3105
|
+
url: '/static-pre-compressed/sample.jpg',
|
|
3106
|
+
headers: {
|
|
3107
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
3108
|
+
}
|
|
3109
|
+
})
|
|
3110
|
+
|
|
3111
|
+
t.assert.deepStrictEqual(response.headers['content-type'], 'image/jpeg')
|
|
3112
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'br')
|
|
3113
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3114
|
+
}
|
|
3115
|
+
)
|
|
3116
|
+
|
|
3117
|
+
test(
|
|
3118
|
+
'will not redirect but serve a file if preCompressed but no compressed file exists and redirect is true',
|
|
3119
|
+
async (t) => {
|
|
3120
|
+
const pluginOptions = {
|
|
3121
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
3122
|
+
prefix: '/static-pre-compressed/',
|
|
3123
|
+
preCompressed: true,
|
|
3124
|
+
redirect: true
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
const fastify = Fastify()
|
|
3128
|
+
|
|
3129
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3130
|
+
t.after(() => fastify.close())
|
|
3131
|
+
|
|
3132
|
+
const response = await fastify.inject({
|
|
3133
|
+
method: 'GET',
|
|
3134
|
+
url: '/static-pre-compressed/baz.json',
|
|
3135
|
+
headers: {
|
|
3136
|
+
'accept-encoding': '*'
|
|
3137
|
+
}
|
|
3138
|
+
})
|
|
3139
|
+
|
|
3140
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3141
|
+
t.assert.deepStrictEqual(response.headers['content-type'], 'application/json; charset=utf-8')
|
|
3142
|
+
}
|
|
3143
|
+
)
|
|
3144
|
+
|
|
3145
|
+
test(
|
|
3146
|
+
'nonexistent index with precompressed option',
|
|
3147
|
+
async (t) => {
|
|
3148
|
+
const pluginOptions = {
|
|
3149
|
+
root: path.join(__dirname, '/static-pre-compressed'),
|
|
3150
|
+
prefix: '/static-pre-compressed/',
|
|
3151
|
+
preCompressed: true
|
|
3152
|
+
}
|
|
3153
|
+
|
|
3154
|
+
const fastify = Fastify()
|
|
3155
|
+
|
|
3156
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3157
|
+
t.after(() => fastify.close())
|
|
3158
|
+
|
|
3159
|
+
const response = await fastify.inject({
|
|
3160
|
+
method: 'GET',
|
|
3161
|
+
url: '/static-pre-compressed/empty/',
|
|
3162
|
+
headers: {
|
|
3163
|
+
'accept-encoding': 'gzip, deflate, br'
|
|
3164
|
+
}
|
|
3165
|
+
})
|
|
3166
|
+
|
|
3167
|
+
t.assert.deepStrictEqual(response.statusCode, 404)
|
|
3168
|
+
genericErrorResponseChecks(t, response)
|
|
3169
|
+
}
|
|
3170
|
+
)
|
|
3171
|
+
|
|
3172
|
+
test('should not redirect to protocol-relative locations', async (t) => {
|
|
3173
|
+
const urls = [
|
|
3174
|
+
['//^/..', '/', 301],
|
|
3175
|
+
['//^/.', null, 404], // it is NOT recognized as a directory by pillarjs/send
|
|
3176
|
+
['//:/..', '/', 301],
|
|
3177
|
+
['/\\\\a//google.com/%2e%2e%2f%2e%2e', '/a//google.com/%2e%2e%2f%2e%2e/', 301],
|
|
3178
|
+
['//a//youtube.com/%2e%2e%2f%2e%2e', '/a//youtube.com/%2e%2e%2f%2e%2e/', 301],
|
|
3179
|
+
['/^', null, 404], // it is NOT recognized as a directory by pillarjs/send
|
|
3180
|
+
['//google.com/%2e%2e', '/', 301],
|
|
3181
|
+
['//users/%2e%2e', '/', 301],
|
|
3182
|
+
['//users', null, 404],
|
|
3183
|
+
['///deep/path//for//test//index.html', null, 200]
|
|
3184
|
+
]
|
|
3185
|
+
|
|
3186
|
+
t.plan(urls.length * 2)
|
|
3187
|
+
const fastify = Fastify()
|
|
3188
|
+
fastify.register(fastifyStatic, {
|
|
3189
|
+
root: path.join(__dirname, '/static'),
|
|
3190
|
+
redirect: true
|
|
3191
|
+
})
|
|
3192
|
+
t.after(() => fastify.close())
|
|
3193
|
+
|
|
3194
|
+
const address = await fastify.listen({ port: 0 })
|
|
3195
|
+
fastify.server.unref()
|
|
3196
|
+
|
|
3197
|
+
const promises = urls.map(([testUrl, expected, status]) => {
|
|
3198
|
+
const { promise, resolve } = Promise.withResolvers()
|
|
3199
|
+
|
|
3200
|
+
const req = http.request(url.parse(address + testUrl), res => {
|
|
3201
|
+
t.assert.deepStrictEqual(res.statusCode, status, `status ${testUrl}`)
|
|
3202
|
+
|
|
3203
|
+
if (expected) {
|
|
3204
|
+
t.assert.deepStrictEqual(res.headers.location, expected)
|
|
3205
|
+
} else {
|
|
3206
|
+
t.assert.ok(!res.headers.location)
|
|
3207
|
+
}
|
|
3208
|
+
|
|
3209
|
+
resolve()
|
|
3210
|
+
})
|
|
3211
|
+
req.on('error', t.assert.fail)
|
|
3212
|
+
req.end()
|
|
3213
|
+
return promise
|
|
3214
|
+
})
|
|
3215
|
+
|
|
3216
|
+
await Promise.all(promises)
|
|
3217
|
+
})
|
|
3218
|
+
|
|
3219
|
+
test('should not serve index if option is `false`', async (t) => {
|
|
3220
|
+
t.plan(2)
|
|
3221
|
+
|
|
3222
|
+
const pluginOptions = {
|
|
3223
|
+
root: path.join(__dirname, '/static'),
|
|
3224
|
+
prefix: '/static',
|
|
3225
|
+
index: false
|
|
3226
|
+
}
|
|
3227
|
+
const fastify = Fastify()
|
|
3228
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3229
|
+
|
|
3230
|
+
t.after(() => fastify.close())
|
|
3231
|
+
|
|
3232
|
+
await fastify.listen({ port: 0 })
|
|
3233
|
+
fastify.server.unref()
|
|
3234
|
+
|
|
3235
|
+
await t.test('/static/index.html', async (t) => {
|
|
3236
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3237
|
+
|
|
3238
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
3239
|
+
t.assert.ok(response.ok)
|
|
3240
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3241
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
3242
|
+
genericResponseChecks(t, response)
|
|
3243
|
+
})
|
|
3244
|
+
|
|
3245
|
+
await t.test('/static', async (t) => {
|
|
3246
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
3247
|
+
|
|
3248
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static')
|
|
3249
|
+
t.assert.ok(!response.ok)
|
|
3250
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
3251
|
+
genericErrorResponseChecks(t, response)
|
|
3252
|
+
})
|
|
3253
|
+
})
|
|
3254
|
+
|
|
3255
|
+
test('should follow symbolic link without wildcard', async (t) => {
|
|
3256
|
+
t.plan(4)
|
|
3257
|
+
const fastify = Fastify()
|
|
3258
|
+
fastify.register(fastifyStatic, {
|
|
3259
|
+
root: path.join(__dirname, '/static-symbolic-link'),
|
|
3260
|
+
wildcard: false
|
|
3261
|
+
})
|
|
3262
|
+
t.after(() => fastify.close())
|
|
3263
|
+
|
|
3264
|
+
await fastify.listen({ port: 0 })
|
|
3265
|
+
fastify.server.unref()
|
|
3266
|
+
|
|
3267
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/origin/subdir/subdir/index.html')
|
|
3268
|
+
t.assert.ok(response.ok)
|
|
3269
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3270
|
+
|
|
3271
|
+
const response2 = await fetch('http://localhost:' + fastify.server.address().port + '/dir/symlink/subdir/subdir/index.html')
|
|
3272
|
+
t.assert.ok(response2.ok)
|
|
3273
|
+
t.assert.deepStrictEqual(response2.status, 200)
|
|
3274
|
+
})
|
|
3275
|
+
|
|
3276
|
+
test('should serve files into hidden dir with wildcard `false`', async (t) => {
|
|
3277
|
+
t.plan(8)
|
|
3278
|
+
|
|
3279
|
+
const pluginOptions = {
|
|
3280
|
+
root: path.join(__dirname, '/static-hidden'),
|
|
3281
|
+
wildcard: false,
|
|
3282
|
+
serveDotFiles: true
|
|
3283
|
+
}
|
|
3284
|
+
const fastify = Fastify()
|
|
3285
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3286
|
+
|
|
3287
|
+
t.after(() => fastify.close())
|
|
3288
|
+
|
|
3289
|
+
await fastify.listen({ port: 0 })
|
|
3290
|
+
fastify.server.unref()
|
|
3291
|
+
|
|
3292
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/.hidden/sample.json')
|
|
3293
|
+
t.assert.ok(response.ok)
|
|
3294
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3295
|
+
t.assert.deepStrictEqual(await response.text(), jsonHiddenContent)
|
|
3296
|
+
t.assert.ok(/application\/(json)/.test(response.headers.get('content-type')))
|
|
3297
|
+
t.assert.ok(response.headers.get('etag'))
|
|
3298
|
+
t.assert.ok(response.headers.get('last-modified'))
|
|
3299
|
+
t.assert.ok(response.headers.get('date'))
|
|
3300
|
+
t.assert.ok(response.headers.get('cache-control'))
|
|
3301
|
+
})
|
|
3302
|
+
|
|
3303
|
+
test('should not found hidden file with wildcard is `false`', async (t) => {
|
|
3304
|
+
t.plan(2)
|
|
3305
|
+
|
|
3306
|
+
const pluginOptions = {
|
|
3307
|
+
root: path.join(__dirname, '/static-hidden'),
|
|
3308
|
+
wildcard: false
|
|
3309
|
+
}
|
|
3310
|
+
const fastify = Fastify()
|
|
3311
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3312
|
+
|
|
3313
|
+
t.after(() => fastify.close())
|
|
3314
|
+
await fastify.listen({ port: 0 })
|
|
3315
|
+
fastify.server.unref()
|
|
3316
|
+
|
|
3317
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/.hidden/sample.json')
|
|
3318
|
+
t.assert.ok(!response.ok)
|
|
3319
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
3320
|
+
})
|
|
3321
|
+
|
|
3322
|
+
test('should serve files into hidden dir without wildcard option', async (t) => {
|
|
3323
|
+
t.plan(8)
|
|
3324
|
+
|
|
3325
|
+
const pluginOptions = {
|
|
3326
|
+
root: path.join(__dirname, '/static-hidden')
|
|
3327
|
+
}
|
|
3328
|
+
const fastify = Fastify()
|
|
3329
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3330
|
+
|
|
3331
|
+
t.after(() => fastify.close())
|
|
3332
|
+
|
|
3333
|
+
await fastify.listen({ port: 0 })
|
|
3334
|
+
fastify.server.unref()
|
|
3335
|
+
|
|
3336
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/.hidden/sample.json')
|
|
3337
|
+
t.assert.ok(response.ok)
|
|
3338
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3339
|
+
t.assert.deepStrictEqual(await response.text(), jsonHiddenContent)
|
|
3340
|
+
t.assert.ok(/application\/(json)/.test(response.headers.get('content-type')))
|
|
3341
|
+
t.assert.ok(response.headers.get('etag'))
|
|
3342
|
+
t.assert.ok(response.headers.get('last-modified'))
|
|
3343
|
+
t.assert.ok(response.headers.get('date'))
|
|
3344
|
+
t.assert.ok(response.headers.get('cache-control'))
|
|
3345
|
+
})
|
|
3346
|
+
|
|
3347
|
+
test(
|
|
3348
|
+
'will serve pre-compressed files with .gzip if multi-root',
|
|
3349
|
+
async (t) => {
|
|
3350
|
+
const pluginOptions = {
|
|
3351
|
+
root: [path.join(__dirname, '/static-pre-compressed'), path.join(__dirname, '/static')],
|
|
3352
|
+
preCompressed: true
|
|
3353
|
+
}
|
|
3354
|
+
|
|
3355
|
+
const fastify = Fastify()
|
|
3356
|
+
|
|
3357
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3358
|
+
t.after(() => fastify.close())
|
|
3359
|
+
|
|
3360
|
+
const response = await fastify.inject({
|
|
3361
|
+
method: 'GET',
|
|
3362
|
+
url: 'all-three.html',
|
|
3363
|
+
headers: {
|
|
3364
|
+
'accept-encoding': '*, *'
|
|
3365
|
+
}
|
|
3366
|
+
})
|
|
3367
|
+
|
|
3368
|
+
genericResponseChecks(t, response)
|
|
3369
|
+
t.assert.deepStrictEqual(response.headers['content-encoding'], 'gzip')
|
|
3370
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3371
|
+
t.assert.deepStrictEqual(response.rawPayload, allThreeGzip)
|
|
3372
|
+
}
|
|
3373
|
+
)
|
|
3374
|
+
|
|
3375
|
+
test(
|
|
3376
|
+
'will still serve un-compressed files with multi-root and preCompressed as true',
|
|
3377
|
+
async (t) => {
|
|
3378
|
+
const pluginOptions = {
|
|
3379
|
+
root: [path.join(__dirname, '/static-pre-compressed'), path.join(__dirname, '/static')],
|
|
3380
|
+
preCompressed: true
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3383
|
+
const fastify = Fastify()
|
|
3384
|
+
|
|
3385
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3386
|
+
t.after(() => fastify.close())
|
|
3387
|
+
|
|
3388
|
+
const response = await fastify.inject({
|
|
3389
|
+
method: 'GET',
|
|
3390
|
+
url: 'foobar.html',
|
|
3391
|
+
headers: {
|
|
3392
|
+
'accept-encoding': '*, *'
|
|
3393
|
+
}
|
|
3394
|
+
})
|
|
3395
|
+
|
|
3396
|
+
genericResponseChecks(t, response)
|
|
3397
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3398
|
+
t.assert.deepStrictEqual(response.body, foobarContent)
|
|
3399
|
+
}
|
|
3400
|
+
)
|
|
3401
|
+
|
|
3402
|
+
test(
|
|
3403
|
+
'converts URL to path',
|
|
3404
|
+
async (t) => {
|
|
3405
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3406
|
+
const pluginOptions = {
|
|
3407
|
+
root: url.pathToFileURL(path.join(__dirname, '/static'))
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
const fastify = Fastify()
|
|
3411
|
+
|
|
3412
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3413
|
+
const response = await fastify.inject({
|
|
3414
|
+
method: 'GET',
|
|
3415
|
+
url: 'foobar.html',
|
|
3416
|
+
headers: {
|
|
3417
|
+
'accept-encoding': '*, *'
|
|
3418
|
+
}
|
|
3419
|
+
})
|
|
3420
|
+
genericResponseChecks(t, response)
|
|
3421
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3422
|
+
t.assert.deepStrictEqual(response.body, foobarContent)
|
|
3423
|
+
}
|
|
3424
|
+
)
|
|
3425
|
+
|
|
3426
|
+
test(
|
|
3427
|
+
'converts array of URLs to path, contains string path',
|
|
3428
|
+
async (t) => {
|
|
3429
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3430
|
+
const pluginOptions = {
|
|
3431
|
+
root: [url.pathToFileURL(path.join(__dirname, '/static')), path.join(__dirname, 'static-dotfiles'), url.pathToFileURL(path.join(__dirname, '/static-pre-compressed'))]
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3434
|
+
const fastify = Fastify()
|
|
3435
|
+
|
|
3436
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3437
|
+
const response = await fastify.inject({
|
|
3438
|
+
method: 'GET',
|
|
3439
|
+
url: 'foobar.html',
|
|
3440
|
+
headers: {
|
|
3441
|
+
'accept-encoding': '*, *'
|
|
3442
|
+
}
|
|
3443
|
+
})
|
|
3444
|
+
genericResponseChecks(t, response)
|
|
3445
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3446
|
+
t.assert.deepStrictEqual(response.body, foobarContent)
|
|
3447
|
+
}
|
|
3448
|
+
)
|
|
3449
|
+
|
|
3450
|
+
test(
|
|
3451
|
+
'serves files with paths that have characters modified by encodeUri when wildcard is false',
|
|
3452
|
+
async (t) => {
|
|
3453
|
+
const aContent = fs.readFileSync(path.join(__dirname, 'static-encode/[...]', 'a .md'), 'utf-8')
|
|
3454
|
+
|
|
3455
|
+
t.plan(4)
|
|
3456
|
+
const pluginOptions = {
|
|
3457
|
+
root: url.pathToFileURL(path.join(__dirname, '/static-encode')),
|
|
3458
|
+
wildcard: false
|
|
3459
|
+
}
|
|
3460
|
+
|
|
3461
|
+
const fastify = Fastify()
|
|
3462
|
+
|
|
3463
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3464
|
+
const response = await fastify.inject({
|
|
3465
|
+
method: 'GET',
|
|
3466
|
+
url: '[...]/a .md',
|
|
3467
|
+
headers: {
|
|
3468
|
+
'accept-encoding': '*, *'
|
|
3469
|
+
}
|
|
3470
|
+
})
|
|
3471
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3472
|
+
t.assert.deepStrictEqual(response.body, aContent)
|
|
3473
|
+
|
|
3474
|
+
const response2 = await fastify.inject({
|
|
3475
|
+
method: 'GET',
|
|
3476
|
+
url: '%5B...%5D/a%20.md',
|
|
3477
|
+
headers: {
|
|
3478
|
+
'accept-encoding': '*, *'
|
|
3479
|
+
}
|
|
3480
|
+
})
|
|
3481
|
+
t.assert.deepStrictEqual(response2.statusCode, 200)
|
|
3482
|
+
t.assert.deepStrictEqual(response2.body, aContent)
|
|
3483
|
+
}
|
|
3484
|
+
)
|
|
3485
|
+
|
|
3486
|
+
test(
|
|
3487
|
+
'serves files with % in the filename',
|
|
3488
|
+
async (t) => {
|
|
3489
|
+
t.plan(2)
|
|
3490
|
+
|
|
3491
|
+
const txtContent = fs.readFileSync(path.join(__dirname, 'static', '100%.txt'), 'utf-8')
|
|
3492
|
+
|
|
3493
|
+
const pluginOptions = {
|
|
3494
|
+
root: url.pathToFileURL(path.join(__dirname, '/static')),
|
|
3495
|
+
wildcard: false
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
const fastify = Fastify()
|
|
3499
|
+
|
|
3500
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3501
|
+
const response = await fastify.inject({
|
|
3502
|
+
method: 'GET',
|
|
3503
|
+
url: '100%25.txt',
|
|
3504
|
+
headers: {
|
|
3505
|
+
'accept-encoding': '*, *'
|
|
3506
|
+
}
|
|
3507
|
+
})
|
|
3508
|
+
t.assert.deepStrictEqual(response.statusCode, 200)
|
|
3509
|
+
t.assert.deepStrictEqual(response.body, txtContent)
|
|
3510
|
+
}
|
|
3511
|
+
)
|
|
3512
|
+
|
|
3513
|
+
test('content-length in head route should not return zero when using wildcard', async t => {
|
|
3514
|
+
t.plan(5)
|
|
3515
|
+
|
|
3516
|
+
const pluginOptions = {
|
|
3517
|
+
root: path.join(__dirname, '/static')
|
|
3518
|
+
}
|
|
3519
|
+
const fastify = Fastify()
|
|
3520
|
+
|
|
3521
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3522
|
+
|
|
3523
|
+
t.after(() => fastify.close())
|
|
3524
|
+
|
|
3525
|
+
await fastify.listen({ port: 0 })
|
|
3526
|
+
fastify.server.unref()
|
|
3527
|
+
|
|
3528
|
+
const file = fs.readFileSync(path.join(__dirname, '/static/index.html'))
|
|
3529
|
+
const contentLength = Buffer.byteLength(file).toString()
|
|
3530
|
+
|
|
3531
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html', { method: 'HEAD' })
|
|
3532
|
+
t.assert.ok(response.ok)
|
|
3533
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3534
|
+
t.assert.deepStrictEqual(response.headers.get('content-type'), 'text/html; charset=utf-8')
|
|
3535
|
+
t.assert.deepStrictEqual(response.headers.get('content-length'), contentLength)
|
|
3536
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
3537
|
+
})
|
|
3538
|
+
|
|
3539
|
+
test('respect the .code when using with sendFile', async t => {
|
|
3540
|
+
t.plan(5)
|
|
3541
|
+
|
|
3542
|
+
const pluginOptions = {
|
|
3543
|
+
root: path.join(__dirname, '/static')
|
|
3544
|
+
}
|
|
3545
|
+
const fastify = Fastify()
|
|
3546
|
+
|
|
3547
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3548
|
+
|
|
3549
|
+
fastify.get('/custom', (_, reply) => {
|
|
3550
|
+
return reply.code(404).type('text/html').sendFile('foo.html')
|
|
3551
|
+
})
|
|
3552
|
+
|
|
3553
|
+
t.after(() => fastify.close())
|
|
3554
|
+
|
|
3555
|
+
await fastify.listen({ port: 0 })
|
|
3556
|
+
fastify.server.unref()
|
|
3557
|
+
|
|
3558
|
+
const file = fs.readFileSync(path.join(__dirname, '/static/foo.html'))
|
|
3559
|
+
const contentLength = Buffer.byteLength(file).toString()
|
|
3560
|
+
|
|
3561
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/custom', { method: 'HEAD' })
|
|
3562
|
+
t.assert.ok(!response.ok)
|
|
3563
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
3564
|
+
t.assert.deepStrictEqual(response.headers.get('content-type'), 'text/html; charset=utf-8')
|
|
3565
|
+
t.assert.deepStrictEqual(response.headers.get('content-length'), contentLength)
|
|
3566
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
3567
|
+
})
|
|
3568
|
+
|
|
3569
|
+
test('respect the .type when using with sendFile with contentType disabled', async t => {
|
|
3570
|
+
t.plan(5)
|
|
3571
|
+
|
|
3572
|
+
const pluginOptions = {
|
|
3573
|
+
root: path.join(__dirname, '/static'),
|
|
3574
|
+
contentType: false
|
|
3575
|
+
}
|
|
3576
|
+
const fastify = Fastify()
|
|
3577
|
+
|
|
3578
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3579
|
+
|
|
3580
|
+
fastify.get('/custom', (_, reply) => {
|
|
3581
|
+
return reply.type('text/html; charset=windows-1252').sendFile('foo.html')
|
|
3582
|
+
})
|
|
3583
|
+
|
|
3584
|
+
t.after(() => fastify.close())
|
|
3585
|
+
|
|
3586
|
+
await fastify.listen({ port: 0 })
|
|
3587
|
+
fastify.server.unref()
|
|
3588
|
+
|
|
3589
|
+
const file = fs.readFileSync(path.join(__dirname, '/static/foo.html'))
|
|
3590
|
+
const contentLength = Buffer.byteLength(file).toString()
|
|
3591
|
+
|
|
3592
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/custom')
|
|
3593
|
+
t.assert.ok(response.ok)
|
|
3594
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3595
|
+
t.assert.deepStrictEqual(response.headers.get('content-type'), 'text/html; charset=windows-1252')
|
|
3596
|
+
t.assert.deepStrictEqual(response.headers.get('content-length'), contentLength)
|
|
3597
|
+
t.assert.deepStrictEqual(await response.text(), fooContent)
|
|
3598
|
+
})
|
|
3599
|
+
|
|
3600
|
+
test('register /static/ with custom log level', async t => {
|
|
3601
|
+
t.plan(9)
|
|
3602
|
+
|
|
3603
|
+
const pluginOptions = {
|
|
3604
|
+
root: path.join(__dirname, '/static'),
|
|
3605
|
+
prefix: '/static/',
|
|
3606
|
+
logLevel: 'warn'
|
|
3607
|
+
}
|
|
3608
|
+
const fastify = Fastify({
|
|
3609
|
+
logger: {
|
|
3610
|
+
stream: {
|
|
3611
|
+
write: (logLine) => {
|
|
3612
|
+
if (logLine.includes('"msg":"incoming request"')) {
|
|
3613
|
+
console.warn(logLine)
|
|
3614
|
+
throw new Error('Should never reach this point since log level is set at WARN!! Unexpected log line: ' + logLine)
|
|
3615
|
+
}
|
|
3616
|
+
},
|
|
3617
|
+
},
|
|
3618
|
+
},
|
|
3619
|
+
})
|
|
3620
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3621
|
+
|
|
3622
|
+
t.after(() => fastify.close())
|
|
3623
|
+
|
|
3624
|
+
await fastify.listen({ port: 0 })
|
|
3625
|
+
fastify.server.unref()
|
|
3626
|
+
|
|
3627
|
+
await t.test('/static/index.html', async (t) => {
|
|
3628
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3629
|
+
|
|
3630
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
3631
|
+
t.assert.ok(response.ok)
|
|
3632
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3633
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
3634
|
+
genericResponseChecks(t, response)
|
|
3635
|
+
})
|
|
3636
|
+
|
|
3637
|
+
await t.test('/static/index.html', async t => {
|
|
3638
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3639
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html', { method: 'HEAD' })
|
|
3640
|
+
t.assert.ok(response.ok)
|
|
3641
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3642
|
+
t.assert.deepStrictEqual(await response.text(), '')
|
|
3643
|
+
genericResponseChecks(t, response)
|
|
3644
|
+
})
|
|
3645
|
+
|
|
3646
|
+
await t.test('/static/index.css', async (t) => {
|
|
3647
|
+
t.plan(2 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3648
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.css')
|
|
3649
|
+
t.assert.ok(response.ok)
|
|
3650
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3651
|
+
genericResponseChecks(t, response)
|
|
3652
|
+
})
|
|
3653
|
+
|
|
3654
|
+
await t.test('/static/', async (t) => {
|
|
3655
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3656
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/')
|
|
3657
|
+
|
|
3658
|
+
t.assert.ok(response.ok)
|
|
3659
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3660
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
3661
|
+
genericResponseChecks(t, response)
|
|
3662
|
+
})
|
|
3663
|
+
|
|
3664
|
+
await t.test('/static/deep/path/for/test/purpose/foo.html', async (t) => {
|
|
3665
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3666
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/purpose/foo.html')
|
|
3667
|
+
|
|
3668
|
+
t.assert.ok(response.ok)
|
|
3669
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3670
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
3671
|
+
genericResponseChecks(t, response)
|
|
3672
|
+
})
|
|
3673
|
+
await t.test('/static/deep/path/for/test/', async (t) => {
|
|
3674
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3675
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/deep/path/for/test/')
|
|
3676
|
+
|
|
3677
|
+
t.assert.ok(response.ok)
|
|
3678
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3679
|
+
t.assert.deepStrictEqual(await response.text(), innerIndex)
|
|
3680
|
+
genericResponseChecks(t, response)
|
|
3681
|
+
})
|
|
3682
|
+
|
|
3683
|
+
await t.test('/static/this/path/for/test', async (t) => {
|
|
3684
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
3685
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/this/path/for/test')
|
|
3686
|
+
|
|
3687
|
+
t.assert.ok(!response.ok)
|
|
3688
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
3689
|
+
genericErrorResponseChecks(t, response)
|
|
3690
|
+
})
|
|
3691
|
+
|
|
3692
|
+
await t.test('/static/this/path/doesnt/exist.html', async (t) => {
|
|
3693
|
+
t.plan(2 + GENERIC_ERROR_RESPONSE_CHECK_COUNT)
|
|
3694
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/this/path/doesnt/exist.html')
|
|
3695
|
+
|
|
3696
|
+
t.assert.ok(!response.ok)
|
|
3697
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
3698
|
+
genericErrorResponseChecks(t, response)
|
|
3699
|
+
})
|
|
3700
|
+
|
|
3701
|
+
await t.test('304', async t => {
|
|
3702
|
+
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3703
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html')
|
|
3704
|
+
|
|
3705
|
+
t.assert.ok(response.ok)
|
|
3706
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3707
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
3708
|
+
genericResponseChecks(t, response)
|
|
3709
|
+
|
|
3710
|
+
const response2 = await fetch('http://localhost:' + fastify.server.address().port + '/static/index.html', {
|
|
3711
|
+
headers: {
|
|
3712
|
+
'if-none-match': response.headers.get('etag')
|
|
3713
|
+
},
|
|
3714
|
+
cache: 'no-cache'
|
|
3715
|
+
})
|
|
3716
|
+
t.assert.ok(!response2.ok)
|
|
3717
|
+
t.assert.deepStrictEqual(response2.status, 304)
|
|
3718
|
+
})
|
|
3719
|
+
})
|
|
3720
|
+
|
|
3721
|
+
test('register with wildcard false and globIgnore', async t => {
|
|
3722
|
+
t.plan(5)
|
|
3723
|
+
|
|
3724
|
+
const indexContent = fs
|
|
3725
|
+
.readFileSync('./test/static-filtered/index.html')
|
|
3726
|
+
.toString('utf8')
|
|
3727
|
+
|
|
3728
|
+
const deepContent = fs
|
|
3729
|
+
.readFileSync('./test/static-filtered/deep/path/to/baz.html')
|
|
3730
|
+
.toString('utf8')
|
|
3731
|
+
|
|
3732
|
+
const pluginOptions = {
|
|
3733
|
+
root: path.join(__dirname, '/static-filtered'),
|
|
3734
|
+
wildcard: false,
|
|
3735
|
+
globIgnore: ['**/*.private']
|
|
3736
|
+
}
|
|
3737
|
+
const fastify = Fastify()
|
|
3738
|
+
fastify.register(fastifyStatic, pluginOptions)
|
|
3739
|
+
|
|
3740
|
+
t.after(() => fastify.close())
|
|
3741
|
+
|
|
3742
|
+
await fastify.listen({ port: 0 })
|
|
3743
|
+
|
|
3744
|
+
fastify.server.unref()
|
|
3745
|
+
|
|
3746
|
+
await t.test('/index.html', async t => {
|
|
3747
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3748
|
+
|
|
3749
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/index.html')
|
|
3750
|
+
t.assert.ok(response.ok)
|
|
3751
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3752
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
3753
|
+
genericResponseChecks(t, response)
|
|
3754
|
+
})
|
|
3755
|
+
|
|
3756
|
+
await t.test('/bar.private', async t => {
|
|
3757
|
+
t.plan(2)
|
|
3758
|
+
|
|
3759
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/bar.private')
|
|
3760
|
+
t.assert.ok(!response.ok)
|
|
3761
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
3762
|
+
await response.text()
|
|
3763
|
+
})
|
|
3764
|
+
|
|
3765
|
+
await t.test('/', async (t) => {
|
|
3766
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3767
|
+
|
|
3768
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port)
|
|
3769
|
+
t.assert.ok(response.ok)
|
|
3770
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3771
|
+
t.assert.deepStrictEqual(await response.text(), indexContent)
|
|
3772
|
+
genericResponseChecks(t, response)
|
|
3773
|
+
})
|
|
3774
|
+
|
|
3775
|
+
await t.test('/deep/path/to/baz.html', async (t) => {
|
|
3776
|
+
t.plan(3 + GENERIC_RESPONSE_CHECK_COUNT)
|
|
3777
|
+
|
|
3778
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/deep/path/to/baz.html')
|
|
3779
|
+
t.assert.ok(response.ok)
|
|
3780
|
+
t.assert.deepStrictEqual(response.status, 200)
|
|
3781
|
+
t.assert.deepStrictEqual(await response.text(), deepContent)
|
|
3782
|
+
genericResponseChecks(t, response)
|
|
3783
|
+
})
|
|
3784
|
+
|
|
3785
|
+
await t.test('/deep/path/to/baz.private', async (t) => {
|
|
3786
|
+
t.plan(2)
|
|
3787
|
+
|
|
3788
|
+
const response = await fetch('http://localhost:' + fastify.server.address().port + '/deep/path/to/baz.private')
|
|
3789
|
+
t.assert.ok(!response.ok)
|
|
3790
|
+
t.assert.deepStrictEqual(response.status, 404)
|
|
3791
|
+
await response.text()
|
|
3792
|
+
})
|
|
3793
|
+
})
|