@psnext/slingcli 3.5.20261007-3 → 3.5.20261026-1
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/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +12 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +94 -1589
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +12 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -7
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +2 -8
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +10 -10
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-env/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-http/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-login/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-process/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +37 -19
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +37 -19
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +5 -5
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-websocket/package.json +5 -5
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +11 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +6 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +6 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +13 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +9 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/models/CognitoIdentityServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/models/errors.js +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js +11 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js +7 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/models/errors.d.ts +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/SigninServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/errors.d.ts +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSOClient.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/models/SSOServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/models/errors.d.ts +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/errors.d.ts +11 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/STSServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/errors.d.ts +7 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/models/errors.d.ts +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/SigninServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/errors.d.ts +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/models/SSOServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/models/errors.d.ts +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/errors.d.ts +11 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/STSServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/errors.d.ts +7 -0
- package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
- package/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +3 -0
- package/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +3 -0
- package/node_modules/@aws-sdk/types/package.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +2 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +21 -86
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +3 -103
- package/node_modules/@earendil-works/pi-codemode/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-TFS67BSI.js → chunk-23QDZLZG.js} +20 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-IB6ONE3U.js → chunk-QPFSTNX5.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{virtual-modules-P5ROWYIG.js → virtual-modules-GRXGP6ZA.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Dispatcher.md +12 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Errors.md +101 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Fetch.md +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +17 -9
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/index.md +22 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/request.js +39 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/util.js +26 -40
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +127 -84
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +97 -21
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +10 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool-base.js +117 -19
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool.js +99 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +34 -11
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +126 -52
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +31 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +116 -24
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +15 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +253 -73
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/util.js +21 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +50 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/body.js +69 -53
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/headers.js +36 -33
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +54 -29
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +33 -12
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/receiver.js +27 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +7 -5
- package/node_modules/@earendil-works/pi-coding-agent/package.json +2 -2
- package/node_modules/@hono/node-server/README.md +2 -0
- package/node_modules/@hono/node-server/dist/index.cjs +1 -1
- package/node_modules/@hono/node-server/dist/index.mjs +1 -1
- package/node_modules/@hono/node-server/dist/serve-static.cjs +2 -1
- package/node_modules/@hono/node-server/dist/serve-static.mjs +2 -1
- package/node_modules/@hono/node-server/package.json +2 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js +10 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts +8 -8
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +10 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts +8 -8
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +15 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +2 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +10 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +10 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1695 -3
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +16 -2
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +10 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js +6 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/UnionSerde.js +26 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/common.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +8 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js +102 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +8 -1
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +8 -1
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +13 -2
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +16 -6
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/parseJsonBody.js +16 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/writeKey.js +3 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/UnionSerde.d.ts +24 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/common.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +28 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +16 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/writeKey.d.ts +4 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +24 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +28 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +15 -11
- package/node_modules/{@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json → @smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +7 -4
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +14 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +29 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -9
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +30 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +60 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +21 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +38 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +4 -0
- package/node_modules/@smithy/core/package.json +2 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/body-parser/README.md +17 -13
- package/node_modules/body-parser/lib/read.js +74 -57
- package/node_modules/body-parser/lib/types/json.js +11 -11
- package/node_modules/body-parser/lib/types/urlencoded.js +5 -5
- package/node_modules/body-parser/lib/utils.js +0 -15
- package/node_modules/body-parser/package.json +7 -12
- package/node_modules/content-disposition/README.md +105 -35
- package/node_modules/content-disposition/dist/index.d.ts +72 -0
- package/node_modules/content-disposition/dist/index.js +388 -0
- package/node_modules/content-disposition/dist/index.js.map +1 -0
- package/node_modules/content-disposition/package.json +31 -19
- package/node_modules/express/Readme.md +15 -9
- package/node_modules/express/lib/application.js +2 -2
- package/node_modules/express/lib/request.js +32 -19
- package/node_modules/express/lib/response.js +27 -30
- package/node_modules/express/node_modules/content-type/LICENSE +22 -0
- package/node_modules/express/node_modules/content-type/README.md +71 -0
- package/node_modules/express/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/express/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/express/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/express/node_modules/content-type/package.json +52 -0
- package/node_modules/express/package.json +10 -10
- package/node_modules/fast-uri/.github/workflows/release.yml +35 -0
- package/node_modules/fast-uri/README.md +8 -0
- package/node_modules/fast-uri/index.js +98 -18
- package/node_modules/fast-uri/lib/utils.js +52 -0
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/host-delimiter-security.test.js +94 -0
- package/node_modules/fast-uri/test/relative-normalization-security.test.js +156 -0
- package/node_modules/fast-uri/test/reserved-path-normalization.test.js +32 -4
- package/node_modules/fast-uri/test/scheme-validation.test.js +53 -14
- package/node_modules/hono/README.md +2 -3
- package/node_modules/hono/dist/cjs/helper/css/common.js +8 -3
- package/node_modules/hono/dist/cjs/helper/css/index.js +1 -1
- package/node_modules/hono/dist/cjs/helper/route/index.js +3 -1
- package/node_modules/hono/dist/cjs/jsx/base.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +8 -0
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +3 -1
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +2 -2
- package/node_modules/hono/dist/cjs/utils/url.js +11 -6
- package/node_modules/hono/dist/helper/css/common.js +8 -3
- package/node_modules/hono/dist/helper/css/index.js +1 -1
- package/node_modules/hono/dist/helper/route/index.js +3 -1
- package/node_modules/hono/dist/jsx/base.js +1 -1
- package/node_modules/hono/dist/middleware/bearer-auth/index.js +8 -0
- package/node_modules/hono/dist/middleware/serve-static/index.js +3 -1
- package/node_modules/hono/dist/router/trie-router/node.js +2 -2
- package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/helper/testing/index.d.ts +2 -1
- package/node_modules/hono/dist/types/hono-base.d.ts +21 -9
- package/node_modules/hono/dist/types/index.d.ts +1 -1
- package/node_modules/hono/dist/types/jsx/components.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/context.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/dom/components.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/dom/css.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/streaming.d.ts +4 -3
- package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +3 -3
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +3 -3
- package/node_modules/hono/dist/types/utils/ipaddr.d.ts +1 -1
- package/node_modules/hono/dist/utils/url.js +11 -6
- package/node_modules/hono/package.json +1 -1
- package/node_modules/ip-address/README.md +70 -70
- package/node_modules/ip-address/dist/common.js +2 -2
- package/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/ip-address/dist/ipv6.js +7 -4
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +3 -0
- package/node_modules/ip-address/dist/v6/constants.js +3 -0
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +3 -2
- package/node_modules/jose/README.md +2 -2
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +5 -4
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -4
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +5 -4
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +5 -5
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +5 -4
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -4
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -4
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +6 -5
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +9 -6
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +7 -5
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +7 -6
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +1 -1
- package/node_modules/jose/dist/types/jwt/sign.d.ts +1 -1
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +1 -1
- package/node_modules/jose/dist/types/jwt/verify.d.ts +3 -5
- package/node_modules/jose/dist/types/key/export.d.ts +1 -1
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +1 -1
- package/node_modules/jose/dist/types/key/import.d.ts +2 -2
- package/node_modules/jose/dist/types/types.d.ts +165 -107
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +2 -2
- package/node_modules/jose/dist/types/util/errors.d.ts +1 -1
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +3 -3
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +8 -8
- package/node_modules/jose/dist/webapi/jwks/local.js +2 -1
- package/node_modules/jose/dist/webapi/jwks/remote.js +4 -4
- package/node_modules/jose/dist/webapi/jws/general/sign.js +3 -3
- package/node_modules/jose/dist/webapi/jws/general/verify.js +3 -3
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +2 -2
- package/node_modules/jose/dist/webapi/jwt/sign.js +2 -2
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +3 -3
- package/node_modules/jose/dist/webapi/key/generate_secret.js +4 -4
- package/node_modules/jose/dist/webapi/lib/asn1.js +2 -2
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +4 -4
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +8 -8
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +14 -14
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +3 -3
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +2 -2
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +11 -11
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +19 -16
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +44 -43
- package/node_modules/jose/dist/webapi/lib/key.js +4 -4
- package/node_modules/jose/dist/webapi/lib/key_management.js +17 -17
- package/node_modules/jose/dist/webapi/lib/validate.js +10 -10
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +12 -12
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -5
- package/node_modules/jose/package.json +1 -1
- package/node_modules/on-finished/index.js +14 -2
- package/node_modules/on-finished/package.json +11 -7
- package/node_modules/qs/.github/THREAT_MODEL.md +4 -2
- package/node_modules/qs/CHANGELOG.md +38 -14
- package/node_modules/qs/README.md +31 -3
- package/node_modules/qs/dist/qs.js +20 -20
- package/node_modules/qs/lib/parse.js +94 -4
- package/node_modules/qs/lib/stringify.js +4 -4
- package/node_modules/qs/lib/utils.js +130 -6
- package/node_modules/qs/package.json +4 -4
- package/node_modules/qs/test/parse.js +174 -0
- package/node_modules/qs/test/stringify.js +263 -33
- package/node_modules/qs/test/utils.js +184 -0
- package/node_modules/undici/docs/docs/api/Client.md +2 -0
- package/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
- package/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
- package/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
- package/node_modules/undici/lib/handler/cache-handler.js +48 -0
- package/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
- package/node_modules/undici/lib/handler/redirect-handler.js +8 -1
- package/node_modules/undici/lib/interceptor/decompress.js +15 -5
- package/node_modules/undici/lib/web/cookies/index.js +3 -1
- package/node_modules/undici/lib/web/cookies/parse.js +138 -137
- package/node_modules/undici/lib/web/cookies/util.js +21 -2
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
- package/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
- package/node_modules/undici/lib/web/fetch/index.js +3 -3
- package/node_modules/undici/lib/web/infra/index.js +14 -0
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/undici/lib/web/websocket/receiver.js +13 -0
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/client.d.ts +14 -0
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/package.json +5 -4
- package/sling-default-packages.json +3 -2
- package/slingshot/index.js +124 -124
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -15
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -39
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +0 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +0 -14
- package/node_modules/content-disposition/index.js +0 -536
- package/node_modules/on-finished/HISTORY.md +0 -98
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/JsonSettings.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/detectBufferParsing.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReplacer.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReviver.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/needsReviver.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -0
- /package/node_modules/{@aws-sdk/core/dist-types/submodules/protocols/json → @smithy/core/dist-types/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReplacer.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReviver.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/needsReviver.d.ts +0 -0
|
@@ -17,7 +17,7 @@ const iconv = require('iconv-lite')
|
|
|
17
17
|
const onFinished = require('on-finished')
|
|
18
18
|
const zlib = require('node:zlib')
|
|
19
19
|
const hasBody = require('type-is').hasBody
|
|
20
|
-
const
|
|
20
|
+
const contentType = require('content-type')
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Module exports.
|
|
@@ -25,6 +25,12 @@ const { getCharset } = require('./utils')
|
|
|
25
25
|
|
|
26
26
|
module.exports = read
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @const
|
|
30
|
+
* whether current node version has zstandard support
|
|
31
|
+
*/
|
|
32
|
+
const hasZstandardSupport = 'createZstdDecompress' in zlib
|
|
33
|
+
|
|
28
34
|
/**
|
|
29
35
|
* Read a request into a buffer and parse.
|
|
30
36
|
*
|
|
@@ -79,38 +85,53 @@ function read (req, res, next, parse, debug, options) {
|
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
let length
|
|
82
|
-
const opts = options
|
|
83
88
|
let stream
|
|
84
89
|
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
const verify = options.verify
|
|
91
|
+
|
|
92
|
+
// assert charset is supported before creating the decompression stream, so an
|
|
93
|
+
// unsupported charset cannot leave a decoder piped with no error listener
|
|
94
|
+
if (verify && encoding !== null && !iconv.encodingExists(encoding)) {
|
|
95
|
+
return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
|
96
|
+
charset: encoding.toLowerCase(),
|
|
97
|
+
type: 'charset.unsupported'
|
|
98
|
+
}))
|
|
99
|
+
}
|
|
87
100
|
|
|
88
101
|
try {
|
|
102
|
+
const contentEncoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
|
|
103
|
+
|
|
104
|
+
debug('content-encoding "%s"', contentEncoding)
|
|
105
|
+
|
|
106
|
+
if (options.inflate === false && contentEncoding !== 'identity') {
|
|
107
|
+
throw createError(415, 'content encoding unsupported', {
|
|
108
|
+
encoding: contentEncoding,
|
|
109
|
+
type: 'encoding.unsupported'
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
89
113
|
// get the content stream
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
114
|
+
if (contentEncoding === 'identity') {
|
|
115
|
+
length = req.headers['content-length']
|
|
116
|
+
stream = req
|
|
117
|
+
} else {
|
|
118
|
+
stream = createDecompressionStream(contentEncoding, debug)
|
|
119
|
+
req.pipe(stream)
|
|
120
|
+
}
|
|
93
121
|
} catch (err) {
|
|
94
122
|
return next(err)
|
|
95
123
|
}
|
|
96
124
|
|
|
97
125
|
// set raw-body options
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
? null
|
|
101
|
-
:
|
|
102
|
-
|
|
103
|
-
// assert charset is supported
|
|
104
|
-
if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {
|
|
105
|
-
return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
|
|
106
|
-
charset: encoding.toLowerCase(),
|
|
107
|
-
type: 'charset.unsupported'
|
|
108
|
-
}))
|
|
126
|
+
const rawBodyOptions = {
|
|
127
|
+
length,
|
|
128
|
+
encoding: verify ? null : encoding,
|
|
129
|
+
limit: options.limit
|
|
109
130
|
}
|
|
110
131
|
|
|
111
132
|
// read body
|
|
112
133
|
debug('read body')
|
|
113
|
-
getBody(stream,
|
|
134
|
+
getBody(stream, rawBodyOptions, function (error, body) {
|
|
114
135
|
if (error) {
|
|
115
136
|
let _error
|
|
116
137
|
|
|
@@ -138,6 +159,17 @@ function read (req, res, next, parse, debug, options) {
|
|
|
138
159
|
return
|
|
139
160
|
}
|
|
140
161
|
|
|
162
|
+
// detach and destroy the decompression stream to
|
|
163
|
+
// avoid decompression errors on the finished stream
|
|
164
|
+
if (stream !== req) {
|
|
165
|
+
req.unpipe(stream)
|
|
166
|
+
stream.on('error', () => {})
|
|
167
|
+
stream.destroy()
|
|
168
|
+
|
|
169
|
+
// consume any remaining bytes so the HTTP request can finish
|
|
170
|
+
req.resume()
|
|
171
|
+
}
|
|
172
|
+
|
|
141
173
|
// verify
|
|
142
174
|
if (verify) {
|
|
143
175
|
try {
|
|
@@ -145,7 +177,7 @@ function read (req, res, next, parse, debug, options) {
|
|
|
145
177
|
verify(req, res, body, encoding)
|
|
146
178
|
} catch (err) {
|
|
147
179
|
next(createError(403, err, {
|
|
148
|
-
body
|
|
180
|
+
body,
|
|
149
181
|
type: err.type || 'entity.verify.failed'
|
|
150
182
|
}))
|
|
151
183
|
return
|
|
@@ -172,38 +204,6 @@ function read (req, res, next, parse, debug, options) {
|
|
|
172
204
|
})
|
|
173
205
|
}
|
|
174
206
|
|
|
175
|
-
/**
|
|
176
|
-
* Get the content stream of the request.
|
|
177
|
-
*
|
|
178
|
-
* @param {Object} req
|
|
179
|
-
* @param {Function} debug
|
|
180
|
-
* @param {boolean} inflate
|
|
181
|
-
* @returns {Object}
|
|
182
|
-
* @private
|
|
183
|
-
*/
|
|
184
|
-
function contentstream (req, debug, inflate) {
|
|
185
|
-
const encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
|
|
186
|
-
const length = req.headers['content-length']
|
|
187
|
-
|
|
188
|
-
debug('content-encoding "%s"', encoding)
|
|
189
|
-
|
|
190
|
-
if (inflate === false && encoding !== 'identity') {
|
|
191
|
-
throw createError(415, 'content encoding unsupported', {
|
|
192
|
-
encoding: encoding,
|
|
193
|
-
type: 'encoding.unsupported'
|
|
194
|
-
})
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (encoding === 'identity') {
|
|
198
|
-
req.length = length
|
|
199
|
-
return req
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
const stream = createDecompressionStream(encoding, debug)
|
|
203
|
-
req.pipe(stream)
|
|
204
|
-
return stream
|
|
205
|
-
}
|
|
206
|
-
|
|
207
207
|
/**
|
|
208
208
|
* Create a decompression stream for the given encoding.
|
|
209
209
|
* @param {string} encoding
|
|
@@ -222,12 +222,16 @@ function createDecompressionStream (encoding, debug) {
|
|
|
222
222
|
case 'br':
|
|
223
223
|
debug('brotli decompress body')
|
|
224
224
|
return zlib.createBrotliDecompress()
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
225
|
+
case 'zstd':
|
|
226
|
+
if (hasZstandardSupport) {
|
|
227
|
+
debug('zstd decompress body')
|
|
228
|
+
return zlib.createZstdDecompress()
|
|
229
|
+
}
|
|
230
230
|
}
|
|
231
|
+
throw createError(415, 'unsupported content encoding "' + encoding + '"', {
|
|
232
|
+
encoding,
|
|
233
|
+
type: 'encoding.unsupported'
|
|
234
|
+
})
|
|
231
235
|
}
|
|
232
236
|
|
|
233
237
|
/**
|
|
@@ -245,3 +249,16 @@ function dump (req, callback) {
|
|
|
245
249
|
req.resume()
|
|
246
250
|
}
|
|
247
251
|
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Get the charset of a request.
|
|
255
|
+
*
|
|
256
|
+
* @param {Object} req
|
|
257
|
+
* @returns {string | undefined}
|
|
258
|
+
* @private
|
|
259
|
+
*/
|
|
260
|
+
function getCharset (req) {
|
|
261
|
+
const header = req.headers['content-type']
|
|
262
|
+
if (!header) return undefined
|
|
263
|
+
return contentType.parse(header).parameters.charset?.toLowerCase()
|
|
264
|
+
}
|
|
@@ -23,7 +23,7 @@ const { normalizeOptions } = require('../utils')
|
|
|
23
23
|
module.exports = json
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* RegExp to match the first non-
|
|
26
|
+
* RegExp to match the first non-whitespace character in a string.
|
|
27
27
|
*
|
|
28
28
|
* Allowed whitespace is defined in RFC 7159:
|
|
29
29
|
*
|
|
@@ -33,7 +33,7 @@ module.exports = json
|
|
|
33
33
|
* %x0A / ; Line feed or New line
|
|
34
34
|
* %x0D ) ; Carriage return
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const FIRST_NON_WHITESPACE_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d]|$)/ // eslint-disable-line no-control-regex
|
|
37
37
|
|
|
38
38
|
const JSON_SYNTAX_CHAR = '#'
|
|
39
39
|
const JSON_SYNTAX_REGEXP = /#+/g
|
|
@@ -80,10 +80,12 @@ function createJsonParser (options) {
|
|
|
80
80
|
return {}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
if (body[0] !== '{' && body[0] !== '[') {
|
|
84
|
+
const first = firstNonWhitespaceChar(body)
|
|
85
|
+
if (first !== '{' && first !== '[') {
|
|
86
|
+
debug('strict violation')
|
|
87
|
+
throw createStrictSyntaxError(body, first)
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
try {
|
|
@@ -152,12 +154,10 @@ function createStrictSyntaxError (str, char) {
|
|
|
152
154
|
* @returns {string|undefined}
|
|
153
155
|
* @private
|
|
154
156
|
*/
|
|
155
|
-
function
|
|
156
|
-
const match =
|
|
157
|
+
function firstNonWhitespaceChar (str) {
|
|
158
|
+
const match = FIRST_NON_WHITESPACE_REGEXP.exec(str)
|
|
157
159
|
|
|
158
|
-
return match
|
|
159
|
-
? match[1]
|
|
160
|
-
: undefined
|
|
160
|
+
return match && match[1] ? match[1] : undefined
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
/**
|
|
@@ -98,12 +98,12 @@ function createQueryParser (options) {
|
|
|
98
98
|
try {
|
|
99
99
|
return qs.parse(body, {
|
|
100
100
|
allowPrototypes: true,
|
|
101
|
-
arrayLimit
|
|
102
|
-
depth
|
|
103
|
-
charsetSentinel
|
|
104
|
-
interpretNumericEntities
|
|
101
|
+
arrayLimit,
|
|
102
|
+
depth,
|
|
103
|
+
charsetSentinel,
|
|
104
|
+
interpretNumericEntities,
|
|
105
105
|
charset: encoding,
|
|
106
|
-
parameterLimit
|
|
106
|
+
parameterLimit,
|
|
107
107
|
strictDepth: true
|
|
108
108
|
})
|
|
109
109
|
} catch (err) {
|
|
@@ -5,31 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const bytes = require('bytes')
|
|
8
|
-
const contentType = require('content-type')
|
|
9
8
|
const typeis = require('type-is')
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Module exports.
|
|
13
12
|
*/
|
|
14
13
|
module.exports = {
|
|
15
|
-
getCharset,
|
|
16
14
|
normalizeOptions,
|
|
17
15
|
passthrough
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
/**
|
|
21
|
-
* Get the charset of a request.
|
|
22
|
-
*
|
|
23
|
-
* @param {Object} req
|
|
24
|
-
* @returns {string | undefined}
|
|
25
|
-
* @private
|
|
26
|
-
*/
|
|
27
|
-
function getCharset (req) {
|
|
28
|
-
const header = req.headers['content-type']
|
|
29
|
-
if (!header) return undefined
|
|
30
|
-
return contentType.parse(header).parameters.charset?.toLowerCase()
|
|
31
|
-
}
|
|
32
|
-
|
|
33
18
|
/**
|
|
34
19
|
* Get the simple type checker.
|
|
35
20
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "body-parser",
|
|
3
3
|
"description": "Node.js body parsing middleware",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.0",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
7
7
|
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
|
@@ -27,26 +27,21 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"bytes": "^3.1.2",
|
|
30
|
-
"content-type": "^2.
|
|
30
|
+
"content-type": "^2.1.0",
|
|
31
31
|
"debug": "^4.4.3",
|
|
32
32
|
"http-errors": "^2.0.1",
|
|
33
|
-
"iconv-lite": "^0.7.
|
|
33
|
+
"iconv-lite": "^0.7.3",
|
|
34
34
|
"on-finished": "^2.4.1",
|
|
35
|
-
"qs": "^6.
|
|
35
|
+
"qs": "^6.16.1",
|
|
36
36
|
"raw-body": "^3.0.2",
|
|
37
37
|
"type-is": "^2.1.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"eslint": "^
|
|
41
|
-
"eslint-config-standard": "^14.1.1",
|
|
42
|
-
"eslint-plugin-import": "^2.32.0",
|
|
43
|
-
"eslint-plugin-markdown": "^3.0.1",
|
|
44
|
-
"eslint-plugin-node": "^11.1.0",
|
|
45
|
-
"eslint-plugin-promise": "^6.6.0",
|
|
46
|
-
"eslint-plugin-standard": "^4.1.0",
|
|
40
|
+
"eslint": "^9.39.5",
|
|
47
41
|
"mocha": "^11.7.6",
|
|
42
|
+
"neostandard": "^0.13.0",
|
|
48
43
|
"nyc": "^17.1.0",
|
|
49
|
-
"supertest": "
|
|
44
|
+
"supertest": "7.3.0"
|
|
50
45
|
},
|
|
51
46
|
"files": [
|
|
52
47
|
"lib/",
|
|
@@ -17,17 +17,17 @@ $ npm install content-disposition
|
|
|
17
17
|
## API
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
|
|
20
|
+
import { create, parse, format } from 'content-disposition';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
###
|
|
23
|
+
### create(filename, options)
|
|
24
24
|
|
|
25
25
|
Create an attachment `Content-Disposition` header value using the given file name,
|
|
26
26
|
if supplied. The `filename` is optional and if no file name is desired, but you
|
|
27
27
|
want to specify `options`, set `filename` to `undefined`.
|
|
28
28
|
|
|
29
29
|
```js
|
|
30
|
-
res.setHeader('Content-Disposition',
|
|
30
|
+
res.setHeader('Content-Disposition', create('∫ maths.pdf'));
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
**note** HTTP headers are of the ISO-8859-1 character set. If you are writing this
|
|
@@ -40,73 +40,139 @@ the `'binary'` encoding in Node.js.
|
|
|
40
40
|
|
|
41
41
|
##### fallback
|
|
42
42
|
|
|
43
|
-
If the `filename` option is outside
|
|
43
|
+
If the `filename` option is outside US-ASCII, then the file name is actually
|
|
44
44
|
stored in a supplemental field for clients that support Unicode file names and
|
|
45
|
-
a
|
|
45
|
+
a US-ASCII version of the file name is automatically generated.
|
|
46
46
|
|
|
47
|
-
This specifies the
|
|
47
|
+
This specifies the US-ASCII file name to override the automatic generation or
|
|
48
48
|
disables the generation all together, defaults to `true`.
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
- A string will specify the US-ASCII file name to use in place of automatic
|
|
51
|
+
generation.
|
|
52
|
+
- `false` will disable including a US-ASCII file name and only include the
|
|
53
|
+
Unicode version (unless the file name is already US-ASCII).
|
|
54
|
+
- `true` will enable automatic generation if the file name is outside US-ASCII.
|
|
55
55
|
|
|
56
|
-
If the `filename` option is
|
|
56
|
+
If the `filename` option is US-ASCII and this option is specified and has a
|
|
57
57
|
different value, then the `filename` option is encoded in the extended field
|
|
58
|
-
and this set as the fallback field, even though they are both
|
|
58
|
+
and this set as the fallback field, even though they are both US-ASCII.
|
|
59
59
|
|
|
60
60
|
##### type
|
|
61
61
|
|
|
62
62
|
Specifies the disposition type, defaults to `"attachment"`. This can also be
|
|
63
63
|
`"inline"`, or any other value (all values except inline are treated like
|
|
64
64
|
`attachment`, but can convey additional information if both parties agree to
|
|
65
|
-
it).
|
|
65
|
+
it).
|
|
66
66
|
|
|
67
|
-
###
|
|
67
|
+
### parse(string, options)
|
|
68
68
|
|
|
69
69
|
```js
|
|
70
|
-
const disposition =
|
|
70
|
+
const disposition = parse(
|
|
71
|
+
'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt',
|
|
72
|
+
);
|
|
71
73
|
```
|
|
72
74
|
|
|
73
75
|
Parse a `Content-Disposition` header string. This automatically handles extended
|
|
74
76
|
("Unicode") parameters by decoding them and providing them under the standard
|
|
75
|
-
parameter name. This will return an object with the following properties
|
|
76
|
-
are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'`):
|
|
77
|
+
parameter name. This will return an object with the following properties:
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
- `type`: The disposition type (always lower case). Example: `'attachment'`
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
- `parameters`: An object of the parameters in the disposition (name of parameter
|
|
82
|
+
always lower case and extended versions replace non-extended versions). Example:
|
|
83
|
+
`{filename: "€ rates.txt"}`
|
|
84
|
+
|
|
85
|
+
#### Options
|
|
86
|
+
|
|
87
|
+
##### multipart
|
|
88
|
+
|
|
89
|
+
Parse parameters using browser `multipart/form-data` behavior.
|
|
90
|
+
|
|
91
|
+
```js
|
|
92
|
+
parse('form-data; name="file"; filename="the %22plans%22.pdf"', {
|
|
93
|
+
multipart: true,
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
##### extended
|
|
98
|
+
|
|
99
|
+
Parse RFC 5987 extended header parameters automatically when decoding
|
|
100
|
+
parameters, defaults to `true`.
|
|
101
|
+
|
|
102
|
+
### format(obj, options)
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
const disposition = format({
|
|
106
|
+
type: 'attachment',
|
|
107
|
+
parameters: {
|
|
108
|
+
filename: '€ rates.txt',
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Formats an object to a `Content-Disposition` header string. This automatically
|
|
114
|
+
handles extended ("Unicode") parameters and returns a string. Example:
|
|
115
|
+
`'attachment; filename*=UTF-8''%E2%82%AC%20rates.txt'`
|
|
116
|
+
|
|
117
|
+
#### Options
|
|
118
|
+
|
|
119
|
+
##### multipart
|
|
120
|
+
|
|
121
|
+
Format parameters using browser `multipart/form-data` behavior. This quotes
|
|
122
|
+
parameter values, escapes `"` as `%22`, and writes Unicode values directly
|
|
123
|
+
instead of using extended parameters.
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
format(
|
|
127
|
+
{
|
|
128
|
+
type: 'form-data',
|
|
129
|
+
parameters: { name: 'file', filename: '€ rates.txt' },
|
|
130
|
+
},
|
|
131
|
+
{ multipart: true },
|
|
132
|
+
);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
##### extended
|
|
136
|
+
|
|
137
|
+
Encode Unicode parameter values using RFC 5987 extended header parameters,
|
|
138
|
+
e.g. `filename*=`, defaults to `true`.
|
|
83
139
|
|
|
84
140
|
## Examples
|
|
85
141
|
|
|
86
142
|
### Send a file for download
|
|
87
143
|
|
|
88
144
|
```js
|
|
89
|
-
const contentDisposition = require('content-disposition')
|
|
90
|
-
const fs = require('fs')
|
|
91
|
-
const http = require('http')
|
|
92
|
-
const onFinished = require('on-finished')
|
|
145
|
+
const contentDisposition = require('content-disposition');
|
|
146
|
+
const fs = require('fs');
|
|
147
|
+
const http = require('http');
|
|
148
|
+
const onFinished = require('on-finished');
|
|
93
149
|
|
|
94
|
-
const filePath = '/path/to/public/plans.pdf'
|
|
150
|
+
const filePath = '/path/to/public/plans.pdf';
|
|
95
151
|
|
|
96
|
-
http.createServer(function onRequest
|
|
152
|
+
http.createServer(function onRequest(req, res) {
|
|
97
153
|
// set headers
|
|
98
|
-
res.setHeader('Content-Type', 'application/pdf')
|
|
99
|
-
res.setHeader('Content-Disposition', contentDisposition(filePath))
|
|
154
|
+
res.setHeader('Content-Type', 'application/pdf');
|
|
155
|
+
res.setHeader('Content-Disposition', contentDisposition(filePath));
|
|
100
156
|
|
|
101
157
|
// send file
|
|
102
|
-
const stream = fs.createReadStream(filePath)
|
|
103
|
-
stream.pipe(res)
|
|
158
|
+
const stream = fs.createReadStream(filePath);
|
|
159
|
+
stream.pipe(res);
|
|
104
160
|
onFinished(res, function () {
|
|
105
|
-
stream.destroy()
|
|
106
|
-
})
|
|
107
|
-
})
|
|
161
|
+
stream.destroy();
|
|
162
|
+
});
|
|
163
|
+
});
|
|
108
164
|
```
|
|
109
165
|
|
|
166
|
+
## Local demo
|
|
167
|
+
|
|
168
|
+
Run the upload inspector locally:
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
npm run demo
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Then open `http://127.0.0.1:3000` in your browser. The demo lets you upload files, inspect the multipart upload part headers sent by the browser, and compare them with the download `Content-Disposition` header generated by this package.
|
|
175
|
+
|
|
110
176
|
## Testing
|
|
111
177
|
|
|
112
178
|
```sh
|
|
@@ -118,11 +184,15 @@ $ npm test
|
|
|
118
184
|
- [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1][rfc-2616]
|
|
119
185
|
- [RFC 5987: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters][rfc-5987]
|
|
120
186
|
- [RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)][rfc-6266]
|
|
187
|
+
- [RFC 8187: Indicating Character Encoding and Language for HTTP Header Field Parameters][rfc-8187]
|
|
188
|
+
- [HTML Living Standard: Multipart form data][html-form]
|
|
121
189
|
- [Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987][tc-2231]
|
|
122
190
|
|
|
123
191
|
[rfc-2616]: https://datatracker.ietf.org/doc/html/rfc2616
|
|
124
192
|
[rfc-5987]: https://datatracker.ietf.org/doc/html/rfc5987
|
|
125
193
|
[rfc-6266]: https://datatracker.ietf.org/doc/html/rfc6266
|
|
194
|
+
[rfc-8187]: https://datatracker.ietf.org/doc/html/rfc8187
|
|
195
|
+
[html-form]: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data
|
|
126
196
|
[tc-2231]: http://greenbytes.de/tech/tc2231/
|
|
127
197
|
|
|
128
198
|
## License
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* content-disposition
|
|
3
|
+
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
4
|
+
* MIT Licensed
|
|
5
|
+
*/
|
|
6
|
+
export interface ContentDisposition {
|
|
7
|
+
/**
|
|
8
|
+
* Content-Disposition type, such as "attachment" or "inline"
|
|
9
|
+
*/
|
|
10
|
+
type: string;
|
|
11
|
+
/**
|
|
12
|
+
* Content-Disposition parameters, such as "filename"
|
|
13
|
+
*/
|
|
14
|
+
parameters: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
export interface CreateOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Content-Disposition type, defaults to "attachment"
|
|
19
|
+
* @default "attachment"
|
|
20
|
+
*/
|
|
21
|
+
type?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Fallback filename for non-US-ASCII strings. If true, a fallback will be generated by replacing non-US-ASCII characters with "?". If false, no fallback will be generated.
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
fallback?: string | boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Create an attachment Content-Disposition header.
|
|
30
|
+
*/
|
|
31
|
+
export declare function create(filename?: string, options?: CreateOptions): string;
|
|
32
|
+
export interface ParseOptions {
|
|
33
|
+
/**
|
|
34
|
+
* Whether to decode RFC 8187 encoded parameters.
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
extended?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Parse parameters as sent by browsers in `multipart/form-data`.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
multipart?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse Content-Disposition header string.
|
|
46
|
+
*/
|
|
47
|
+
export declare function parse(header: string, options?: ParseOptions): ContentDisposition;
|
|
48
|
+
/**
|
|
49
|
+
* Decode a RFC 8187 field value (gracefully).
|
|
50
|
+
*/
|
|
51
|
+
export declare function decodeExtended(str: string): string | undefined;
|
|
52
|
+
export interface FormatOptions {
|
|
53
|
+
/**
|
|
54
|
+
* Whether to use extended parameter encoding for non-ISO-8859-1 strings.
|
|
55
|
+
* If false, an error will be thrown when formatting such strings.
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
58
|
+
extended?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Format parameters as sent by browsers in `multipart/form-data`.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
multipart?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Format object to Content-Disposition header.
|
|
67
|
+
*/
|
|
68
|
+
export declare function format(obj: Partial<ContentDisposition>, options?: FormatOptions): string;
|
|
69
|
+
/**
|
|
70
|
+
* Encode a Unicode string for HTTP (RFC 8187).
|
|
71
|
+
*/
|
|
72
|
+
export declare function encodeExtended(str: string): string;
|