@yanglaofish/fishtools 0.5.2 → 0.5.3
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/README.md +23 -11
- package/manual/README.md +23 -11
- package/manual/docs/deployment.md +3 -3
- package/manual/docs/examples/action-plugin/package.json +1 -1
- package/manual/docs/plugin-development.md +15 -4
- package/manual/docs/releases.md +24 -0
- package/manual/docs/superpowers/plans/2026-10-13-command-shortcuts.md +3 -2
- package/manual/docs/superpowers/plans/2026-10-13-global-plugins.md +56 -0
- package/manual/docs/superpowers/plans/2026-10-13-tui-readable-sessions.md +21 -0
- package/manual/docs/superpowers/reviews/2026-10-13-0.5.3-review.md +28 -0
- package/manual/docs/superpowers/reviews/2026-10-13-command-shortcuts-review.md +7 -0
- package/manual/docs/superpowers/reviews/2026-10-13-tui-sessions-review.md +55 -0
- package/manual/docs/superpowers/specs/2026-10-13-issue-4-workflow-menu.md +23 -0
- package/manual/docs/superpowers/specs/2026-10-13-issue-5-results-and-history.md +20 -0
- package/manual/docs/terminal-commands.md +8 -0
- package/manual/docs/verification.md +30 -0
- package/manual/packages/core/README.md +2 -0
- package/manual/packages/core/package.json +1 -1
- package/manual/packages/core/src/application.js +100 -51
- package/manual/packages/core/src/development-watch-worker.js +10 -1
- package/manual/packages/core/src/development.js +1 -1
- package/manual/packages/core/src/plugin-catalog.js +42 -0
- package/manual/packages/core/src/version.js +1 -1
- package/manual/packages/fst-cli/README.md +4 -0
- package/manual/packages/fst-cli/bin/fst.js +7 -6
- package/manual/packages/fst-cli/package.json +1 -1
- package/manual/packages/fst-cli/src/development.js +6 -1
- package/manual/packages/fst-cli/src/terminal/command-menu.js +8 -3
- package/manual/packages/fst-cli/src/terminal/navigation.js +2 -0
- package/manual/packages/fst-cli/src/terminal/presentation.js +4 -3
- package/manual/packages/fst-cli/src/terminal/run-feed.js +69 -13
- package/manual/packages/fst-cli/src/terminal/run-presentation.js +55 -12
- package/manual/packages/fst-cli/src/terminal/run-viewer.js +26 -10
- package/manual/packages/fst-cli/src/terminal/session-history.js +82 -0
- package/manual/packages/fst-cli/src/terminal/session.js +119 -40
- package/manual/packages/fst-cli/src/terminal/view.js +31 -8
- package/manual/packages/fst-cli/src/terminal/workflow-menu.js +14 -9
- package/manual/packages/fst-devtools/package.json +2 -2
- package/manual/packages/fst-devtools/src/plugin-tools.js +1 -1
- package/manual/packages/fst-logs/README.md +23 -2
- package/manual/packages/fst-logs/package.json +2 -1
- package/manual/packages/fst-logs/src/file-identity.js +23 -0
- package/manual/packages/fst-logs/src/markdown-log.js +4 -3
- package/manual/packages/fst-logs/src/run-logs.js +3 -2
- package/manual/packages/fst-logs/src/session-history.js +180 -0
- package/manual/packages/fst-platform/README.md +4 -0
- package/manual/packages/fst-platform/package.json +3 -3
- package/manual/packages/fst-platform/src/process.js +4 -1
- package/manual/packages/fst-platform/src/shell.js +46 -1
- package/manual/packages/fst-plugin/package.json +1 -1
- package/manual/packages/fst-plugin/src/host.js +31 -23
- package/manual/packages/fst-workflow/package.json +1 -1
- package/manual/packages/fst-workflow/src/engine.js +1 -1
- package/manual/packages/fst-workspace/README.md +2 -0
- package/manual/packages/fst-workspace/package.json +2 -1
- package/manual/packages/fst-workspace/src/plugin-registry.js +58 -0
- package/manual/packages/fst-workspace/src/plugins.js +7 -4
- package/manual/packages/fst-workspace/src/workflows.js +5 -3
- package/manual/packages/pack/package.json +3 -3
- package/manual/packages/pack/runtime-cache.js +26 -0
- package/manual/packages/pack/runtime.js +6 -10
- package/manual/plugins/commands/package.json +1 -1
- package/node_modules/@mytools/commands/package.json +1 -1
- package/node_modules/@mytools/core/README.md +2 -0
- package/node_modules/@mytools/core/package.json +1 -1
- package/node_modules/@mytools/core/src/application.js +100 -51
- package/node_modules/@mytools/core/src/development-watch-worker.js +10 -1
- package/node_modules/@mytools/core/src/development.js +1 -1
- package/node_modules/@mytools/core/src/plugin-catalog.js +42 -0
- package/node_modules/@mytools/core/src/version.js +1 -1
- package/node_modules/@mytools/fst-cli/README.md +4 -0
- package/node_modules/@mytools/fst-cli/bin/fst.js +7 -6
- package/node_modules/@mytools/fst-cli/package.json +1 -1
- package/node_modules/@mytools/fst-cli/src/development.js +6 -1
- package/node_modules/@mytools/fst-cli/src/terminal/command-menu.js +8 -3
- package/node_modules/@mytools/fst-cli/src/terminal/navigation.js +2 -0
- package/node_modules/@mytools/fst-cli/src/terminal/presentation.js +4 -3
- package/node_modules/@mytools/fst-cli/src/terminal/run-feed.js +69 -13
- package/node_modules/@mytools/fst-cli/src/terminal/run-presentation.js +55 -12
- package/node_modules/@mytools/fst-cli/src/terminal/run-viewer.js +26 -10
- package/node_modules/@mytools/fst-cli/src/terminal/session-history.js +82 -0
- package/node_modules/@mytools/fst-cli/src/terminal/session.js +119 -40
- package/node_modules/@mytools/fst-cli/src/terminal/view.js +31 -8
- package/node_modules/@mytools/fst-cli/src/terminal/workflow-menu.js +14 -9
- package/node_modules/@mytools/fst-devtools/package.json +2 -2
- package/node_modules/@mytools/fst-devtools/src/plugin-tools.js +1 -1
- package/node_modules/@mytools/fst-logs/README.md +23 -2
- package/node_modules/@mytools/fst-logs/package.json +2 -1
- package/node_modules/@mytools/fst-logs/src/file-identity.js +23 -0
- package/node_modules/@mytools/fst-logs/src/markdown-log.js +4 -3
- package/node_modules/@mytools/fst-logs/src/run-logs.js +3 -2
- package/node_modules/@mytools/fst-logs/src/session-history.js +180 -0
- package/node_modules/@mytools/fst-platform/README.md +4 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/LICENSE +21 -0
- package/node_modules/{undici/docs/docs/index.md → @mytools/fst-platform/node_modules/undici/README.md} +85 -137
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Agent.md +84 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Client.md +288 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Connector.md +115 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/ContentType.md +57 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Cookies.md +128 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Debug.md +62 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +317 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Dispatcher.md +1393 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Errors.md +49 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/EventSource.md +45 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Fetch.md +60 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockClient.md +81 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockPool.md +555 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Pool.md +84 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +275 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Util.md +25 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/docs/docs/best-practices/crawling.md +1 -3
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/docs/docs/best-practices/undici-vs-builtin-fetch.md +8 -10
- package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/index-fetch.js +65 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/index.d.ts +3 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/index.js +234 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/abort-signal.js +59 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-connect.js +110 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-pipeline.js +252 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-request.js +214 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-stream.js +209 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-upgrade.js +111 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/index.js +7 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/readable.js +580 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/cache/memory-cache-store.js +3 -3
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/cache/sqlite-cache-store.js +1 -3
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/connect.js +153 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/constants.js +143 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/diagnostics.js +227 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/errors.js +477 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/request.js +485 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/symbols.js +75 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/tree.js +160 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/util.js +992 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/agent.js +158 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/balanced-pool.js +221 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/client-h1.js +1746 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/client-h2.js +1060 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/client.js +668 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/dispatcher-base.js +184 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/dispatcher/h2c-client.js +4 -4
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/pool.js +118 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/proxy-agent.js +319 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/dispatcher/round-robin-pool.js +10 -32
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/dispatcher/socks5-proxy-agent.js +63 -153
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/global.js +59 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/handler/cache-handler.js +7 -49
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/handler/cache-revalidation-handler.js +0 -10
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/decorator-handler.js +67 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/handler/deduplication-handler.js +10 -29
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/redirect-handler.js +238 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/retry-handler.js +504 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/unwrap-handler.js +106 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/wrap-handler.js +105 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/interceptor/cache.js +26 -79
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/interceptor/decompress.js +3 -13
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/interceptor/deduplicate.js +4 -5
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/dns.js +571 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/dump.js +99 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/redirect.js +21 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/response-error.js +95 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/retry.js +19 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/constants.js +531 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/utils.js +12 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-agent.js +232 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/mock-call-history.js +1 -1
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-client.js +68 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-errors.js +29 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-pool.js +68 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-symbols.js +32 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-utils.js +486 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/snapshot-agent.js +7 -25
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/snapshot-recorder.js +3 -38
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/cache.js +10 -92
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/util/promise.js +28 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/runtime-features.js +34 -3
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/util/timers.js +425 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cache/cache.js +864 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cache/util.js +45 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/constants.js +12 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/index.js +199 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/parse.js +314 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/util.js +352 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/eventsource/eventsource-stream.js +494 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/eventsource/eventsource.js +501 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/eventsource/util.js +29 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/LICENSE +21 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/body.js +509 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/constants.js +131 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/data-url.js +596 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/formdata.js +259 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/global.js +40 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/headers.js +719 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/index.js +2413 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/request.js +1115 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/response.js +641 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/util.js +1522 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/infra/index.js +1 -16
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/webidl/index.js +21 -7
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/connection.js +339 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/constants.js +126 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/events.js +331 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/frame.js +133 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/permessage-deflate.js +105 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/receiver.js +507 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/sender.js +109 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/websocket/stream/websocketerror.js +10 -13
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/websocket/stream/websocketstream.js +14 -29
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/util.js +347 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/websocket.js +758 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/package.json +152 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/scripts/strip-comments.js +10 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/README.md +6 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/agent.d.ts +32 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/api.d.ts +43 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/balanced-pool.d.ts +30 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/cache.d.ts +36 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/client.d.ts +139 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/connector.d.ts +36 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/content-type.d.ts +21 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/cookies.d.ts +30 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/dispatcher.d.ts +275 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/errors.d.ts +177 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/eventsource.d.ts +66 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/fetch.d.ts +231 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/formdata.d.ts +114 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/global-dispatcher.d.ts +9 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/global-origin.d.ts +7 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/h2c-client.d.ts +6 -6
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/handlers.d.ts +14 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/header.d.ts +160 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/index.d.ts +91 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/interceptors.d.ts +82 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-agent.d.ts +68 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-client.d.ts +27 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-errors.d.ts +12 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-interceptor.d.ts +94 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-pool.d.ts +27 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/patch.d.ts +29 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/pool-stats.d.ts +19 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/pool.d.ts +41 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/proxy-agent.d.ts +29 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/readable.d.ts +68 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/retry-agent.d.ts +8 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/retry-handler.d.ts +125 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/round-robin-pool.d.ts +2 -0
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/snapshot-agent.d.ts +0 -4
- package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/socks5-proxy-agent.d.ts +2 -4
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/util.d.ts +18 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/webidl.d.ts +347 -0
- package/node_modules/@mytools/fst-platform/node_modules/undici/types/websocket.d.ts +188 -0
- package/node_modules/@mytools/fst-platform/package.json +3 -3
- package/node_modules/@mytools/fst-platform/src/process.js +4 -1
- package/node_modules/@mytools/fst-platform/src/shell.js +46 -1
- package/node_modules/@mytools/fst-plugin/package.json +1 -1
- package/node_modules/@mytools/fst-plugin/src/host.js +31 -23
- package/node_modules/@mytools/fst-workflow/package.json +1 -1
- package/node_modules/@mytools/fst-workflow/src/engine.js +1 -1
- package/node_modules/@mytools/fst-workspace/README.md +2 -0
- package/node_modules/@mytools/fst-workspace/package.json +2 -1
- package/node_modules/@mytools/fst-workspace/src/plugin-registry.js +58 -0
- package/node_modules/@mytools/fst-workspace/src/plugins.js +7 -4
- package/node_modules/@mytools/fst-workspace/src/workflows.js +5 -3
- package/node_modules/@mytools/pack/package.json +3 -3
- package/node_modules/@mytools/pack/runtime-cache.js +26 -0
- package/node_modules/@mytools/pack/runtime.js +6 -10
- package/node_modules/@mytools/web/public/THIRD_PARTY_NOTICES.txt +953 -963
- package/node_modules/@npmcli/agent/lib/agents.js +0 -10
- package/node_modules/@npmcli/agent/package.json +12 -11
- package/node_modules/@npmcli/arborist/README.md +2 -2
- package/node_modules/@npmcli/arborist/bin/index.js +2 -1
- package/node_modules/@npmcli/arborist/bin/shrinkwrap.js +7 -0
- package/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js +25 -159
- package/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js +49 -11
- package/node_modules/@npmcli/arborist/lib/arborist/load-actual.js +0 -67
- package/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js +37 -5
- package/node_modules/@npmcli/arborist/lib/arborist/rebuild.js +8 -15
- package/node_modules/@npmcli/arborist/lib/arborist/reify.js +42 -59
- package/node_modules/@npmcli/arborist/lib/consistent-resolve.js +1 -1
- package/node_modules/@npmcli/arborist/lib/diff.js +22 -17
- package/node_modules/@npmcli/arborist/lib/edge.js +2 -22
- package/node_modules/@npmcli/arborist/lib/index.js +0 -2
- package/node_modules/@npmcli/arborist/lib/isolated-classes.js +1 -4
- package/node_modules/@npmcli/arborist/lib/node.js +9 -13
- package/node_modules/@npmcli/arborist/lib/place-dep.js +0 -6
- package/node_modules/@npmcli/arborist/lib/printable.js +5 -0
- package/node_modules/@npmcli/arborist/lib/shrinkwrap.js +32 -55
- package/node_modules/@npmcli/arborist/package.json +26 -32
- package/node_modules/@npmcli/fs/lib/move-file.js +5 -5
- package/node_modules/@npmcli/fs/package.json +5 -5
- package/node_modules/@npmcli/git/package.json +12 -13
- package/node_modules/@npmcli/installed-package-contents/package.json +7 -7
- package/node_modules/@npmcli/map-workspaces/package.json +7 -7
- package/node_modules/@npmcli/metavuln-calculator/package.json +16 -10
- package/node_modules/@npmcli/name-from-folder/package.json +16 -13
- package/node_modules/@npmcli/node-gyp/package.json +5 -5
- package/node_modules/@npmcli/package-json/lib/index.js +1 -2
- package/node_modules/@npmcli/package-json/lib/normalize.js +22 -23
- package/node_modules/@npmcli/package-json/package.json +10 -11
- package/node_modules/@npmcli/promise-spawn/README.md +2 -1
- package/node_modules/@npmcli/promise-spawn/package.json +5 -5
- package/node_modules/@npmcli/redact/package.json +4 -4
- package/node_modules/@npmcli/run-script/lib/is-server-package.js +11 -0
- package/node_modules/@npmcli/run-script/lib/make-spawn-args.js +6 -5
- package/node_modules/@npmcli/run-script/lib/run-script-pkg.js +13 -4
- package/node_modules/@npmcli/run-script/lib/run-script.js +2 -1
- package/node_modules/@npmcli/run-script/package.json +11 -12
- package/node_modules/@sigstore/bundle/README.md +1 -1
- package/node_modules/@sigstore/bundle/dist/error.js +0 -1
- package/node_modules/@sigstore/bundle/package.json +2 -2
- package/node_modules/@sigstore/core/README.md +1 -1
- package/node_modules/@sigstore/core/dist/asn1/length.js +1 -12
- package/node_modules/@sigstore/core/dist/asn1/obj.js +7 -25
- package/node_modules/@sigstore/core/dist/asn1/parse.js +5 -24
- package/node_modules/@sigstore/core/package.json +2 -2
- package/node_modules/@sigstore/sign/README.md +1 -1
- package/node_modules/@sigstore/sign/dist/signer/fulcio/ephemeral.js +1 -1
- package/node_modules/@sigstore/sign/package.json +9 -9
- package/node_modules/@sigstore/tuf/README.md +1 -1
- package/node_modules/@sigstore/tuf/package.json +4 -4
- package/node_modules/@sigstore/tuf/seeds.json +1 -1
- package/node_modules/@sigstore/verify/README.md +1 -1
- package/node_modules/@sigstore/verify/dist/bundle/dsse.d.ts +0 -1
- package/node_modules/@sigstore/verify/dist/bundle/dsse.js +0 -6
- package/node_modules/@sigstore/verify/dist/bundle/message.d.ts +0 -1
- package/node_modules/@sigstore/verify/dist/bundle/message.js +0 -5
- package/node_modules/@sigstore/verify/dist/policy.d.ts +1 -1
- package/node_modules/@sigstore/verify/dist/policy.js +2 -0
- package/node_modules/@sigstore/verify/dist/shared.types.d.ts +1 -6
- package/node_modules/@sigstore/verify/dist/tlog/checkpoint.js +3 -17
- package/node_modules/@sigstore/verify/dist/tlog/hashedrekord.js +4 -4
- package/node_modules/@sigstore/verify/dist/tlog/index.js +1 -13
- package/node_modules/@sigstore/verify/dist/tlog/merkle.js +1 -12
- package/node_modules/@sigstore/verify/dist/verifier.js +5 -13
- package/node_modules/@sigstore/verify/package.json +5 -5
- package/node_modules/@tufjs/models/package.json +3 -3
- package/node_modules/abbrev/package.json +8 -9
- package/node_modules/agent-base/dist/helpers.d.ts +5 -0
- package/node_modules/agent-base/dist/helpers.d.ts.map +1 -1
- package/node_modules/agent-base/dist/helpers.js +34 -5
- package/node_modules/agent-base/dist/helpers.js.map +1 -1
- package/node_modules/agent-base/dist/index.d.ts +5 -1
- package/node_modules/agent-base/dist/index.d.ts.map +1 -1
- package/node_modules/agent-base/dist/index.js +40 -8
- package/node_modules/agent-base/dist/index.js.map +1 -1
- package/node_modules/agent-base/package.json +12 -12
- package/node_modules/bin-links/README.md +4 -5
- package/node_modules/bin-links/lib/fix-bin.js +1 -3
- package/node_modules/bin-links/lib/index.js +16 -8
- package/node_modules/bin-links/lib/link-mans.js +53 -0
- package/node_modules/bin-links/package.json +12 -11
- package/node_modules/cacache/lib/content/write.js +0 -2
- package/node_modules/cacache/lib/entry-index.js +0 -3
- package/node_modules/cacache/lib/rm.js +0 -1
- package/node_modules/cacache/lib/util/tmp.js +1 -5
- package/node_modules/cacache/lib/verify.js +2 -2
- package/node_modules/cacache/package.json +7 -7
- package/node_modules/cmd-shim/lib/index.js +32 -67
- package/node_modules/cmd-shim/package.json +5 -5
- package/node_modules/hosted-git-info/README.md +1 -1
- package/node_modules/hosted-git-info/lib/parse-url.js +3 -1
- package/node_modules/hosted-git-info/package.json +4 -4
- package/node_modules/http-proxy-agent/dist/index.d.ts +5 -8
- package/node_modules/http-proxy-agent/dist/index.d.ts.map +1 -1
- package/node_modules/http-proxy-agent/dist/index.js +42 -26
- package/node_modules/http-proxy-agent/dist/index.js.map +1 -1
- package/node_modules/http-proxy-agent/package.json +14 -15
- package/node_modules/https-proxy-agent/dist/index.d.ts +5 -9
- package/node_modules/https-proxy-agent/dist/index.d.ts.map +1 -1
- package/node_modules/https-proxy-agent/dist/index.js +44 -98
- package/node_modules/https-proxy-agent/dist/index.js.map +1 -1
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +3 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +1 -1
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +10 -3
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -1
- package/node_modules/https-proxy-agent/package.json +15 -16
- package/node_modules/ignore-walk/package.json +4 -4
- package/node_modules/ini/package.json +5 -5
- package/node_modules/ip-address/README.md +70 -70
- 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 +2 -1
- package/node_modules/json-parse-even-better-errors/lib/index.js +1 -3
- package/node_modules/json-parse-even-better-errors/package.json +17 -13
- package/node_modules/make-fetch-happen/package.json +11 -11
- package/node_modules/minipass-fetch/package.json +4 -4
- package/node_modules/node-gyp/.release-please-manifest.json +1 -1
- package/node_modules/node-gyp/CHANGELOG.md +0 -102
- package/node_modules/node-gyp/README.md +2 -3
- package/node_modules/node-gyp/eslint.config.js +1 -4
- package/node_modules/node-gyp/gyp/.release-please-manifest.json +1 -1
- package/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +19 -14
- package/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +2 -7
- package/node_modules/node-gyp/gyp/pyproject.toml +1 -1
- package/node_modules/node-gyp/lib/build.js +6 -18
- package/node_modules/node-gyp/lib/create-config-gypi.js +0 -5
- package/node_modules/node-gyp/lib/node-gyp.js +2 -9
- package/node_modules/node-gyp/lib/rebuild.js +3 -3
- package/node_modules/node-gyp/package.json +9 -11
- package/node_modules/nopt/README.md +4 -2
- package/node_modules/nopt/lib/debug.js +5 -0
- package/node_modules/nopt/lib/nopt-lib.js +43 -7
- package/node_modules/nopt/lib/nopt.js +4 -2
- package/node_modules/nopt/lib/type-defs.js +13 -8
- package/node_modules/nopt/package.json +17 -15
- package/node_modules/npm-bundled/package.json +6 -6
- package/node_modules/npm-install-checks/package.json +5 -5
- package/node_modules/npm-normalize-package-bin/package.json +16 -13
- package/node_modules/npm-package-arg/package.json +7 -7
- package/node_modules/npm-packlist/README.md +30 -45
- package/node_modules/npm-packlist/lib/index.js +47 -115
- package/node_modules/npm-packlist/package.json +8 -10
- package/node_modules/npm-pick-manifest/package.json +19 -15
- package/node_modules/npm-registry-fetch/lib/errors.js +3 -8
- package/node_modules/npm-registry-fetch/package.json +12 -12
- package/node_modules/pacote/lib/dir.js +5 -60
- package/node_modules/pacote/lib/fetcher.js +0 -4
- package/node_modules/pacote/lib/git.js +3 -11
- package/node_modules/pacote/lib/util/add-git-sha.js +1 -1
- package/node_modules/pacote/package.json +18 -19
- package/node_modules/parse-conflict-json/package.json +6 -6
- package/node_modules/proc-log/package.json +4 -4
- package/node_modules/read-cmd-shim/lib/index.js +1 -1
- package/node_modules/read-cmd-shim/package.json +18 -14
- package/node_modules/sigstore/README.md +1 -1
- package/node_modules/sigstore/package.json +10 -10
- package/node_modules/socks-proxy-agent/dist/index.d.ts +3 -1
- package/node_modules/socks-proxy-agent/dist/index.d.ts.map +1 -1
- package/node_modules/socks-proxy-agent/dist/index.js +43 -17
- package/node_modules/socks-proxy-agent/dist/index.js.map +1 -1
- package/node_modules/socks-proxy-agent/package.json +15 -15
- package/node_modules/ssri/package.json +4 -4
- package/node_modules/tuf-js/dist/config.d.ts +2 -2
- package/node_modules/tuf-js/dist/fetcher.d.ts +4 -4
- package/node_modules/tuf-js/dist/fetcher.js +16 -55
- package/node_modules/tuf-js/dist/updater.js +2 -2
- package/node_modules/tuf-js/package.json +8 -8
- package/node_modules/undici/README.md +72 -405
- package/node_modules/undici/docs/docs/api/Agent.md +41 -252
- package/node_modules/undici/docs/docs/api/BalancedPool.md +48 -246
- package/node_modules/undici/docs/docs/api/CacheStorage.md +13 -171
- package/node_modules/undici/docs/docs/api/Client.md +139 -395
- package/node_modules/undici/docs/docs/api/Connector.md +35 -118
- package/node_modules/undici/docs/docs/api/ContentType.md +25 -65
- package/node_modules/undici/docs/docs/api/Cookies.md +47 -125
- package/node_modules/undici/docs/docs/api/Debug.md +31 -47
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +97 -409
- package/node_modules/undici/docs/docs/api/DispatchInterceptor.md +60 -0
- package/node_modules/undici/docs/docs/api/Dispatcher.md +1011 -500
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +96 -105
- package/node_modules/undici/docs/docs/api/Errors.md +28 -528
- package/node_modules/undici/docs/docs/api/EventSource.md +13 -326
- package/node_modules/undici/docs/docs/api/Fetch.md +24 -693
- package/node_modules/undici/docs/docs/api/MockAgent.md +264 -346
- package/node_modules/undici/docs/docs/api/MockClient.md +31 -153
- package/node_modules/undici/docs/docs/api/MockErrors.md +5 -56
- package/node_modules/undici/docs/docs/api/MockPool.md +253 -324
- package/node_modules/undici/docs/docs/api/Pool.md +41 -235
- package/node_modules/undici/docs/docs/api/PoolStats.md +13 -119
- package/node_modules/undici/docs/docs/api/ProxyAgent.md +81 -198
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +58 -238
- package/node_modules/undici/docs/docs/api/RetryAgent.md +28 -119
- package/node_modules/undici/docs/docs/api/RetryHandler.md +78 -161
- package/node_modules/undici/docs/docs/api/Util.md +11 -68
- package/node_modules/undici/docs/docs/api/WebSocket.md +24 -509
- package/node_modules/undici/docs/docs/api/api-lifecycle.md +33 -101
- package/node_modules/undici/docs/docs/best-practices/client-certificate.md +0 -2
- package/node_modules/undici/docs/docs/best-practices/mocking-request.md +2 -58
- package/node_modules/undici/docs/docs/best-practices/proxy.md +1 -3
- package/node_modules/undici/docs/docs/best-practices/writing-tests.md +0 -45
- package/node_modules/undici/index-fetch.js +4 -34
- package/node_modules/undici/index.d.ts +1 -1
- package/node_modules/undici/index.js +20 -87
- package/node_modules/undici/lib/api/abort-signal.js +0 -2
- package/node_modules/undici/lib/api/api-connect.js +11 -15
- package/node_modules/undici/lib/api/api-pipeline.js +19 -33
- package/node_modules/undici/lib/api/api-request.js +59 -89
- package/node_modules/undici/lib/api/api-stream.js +64 -114
- package/node_modules/undici/lib/api/api-upgrade.js +13 -26
- package/node_modules/undici/lib/api/readable.js +87 -317
- package/node_modules/undici/lib/api/util.js +93 -0
- package/node_modules/undici/lib/core/connect.js +125 -77
- package/node_modules/undici/lib/core/constants.js +9 -11
- package/node_modules/undici/lib/core/diagnostics.js +129 -154
- package/node_modules/undici/lib/core/errors.js +50 -122
- package/node_modules/undici/lib/core/request.js +87 -172
- package/node_modules/undici/lib/core/symbols.js +2 -14
- package/node_modules/undici/lib/core/tree.js +2 -10
- package/node_modules/undici/lib/core/util.js +190 -481
- package/node_modules/undici/lib/dispatcher/agent.js +35 -83
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +38 -46
- package/node_modules/undici/lib/dispatcher/client-h1.js +199 -492
- package/node_modules/undici/lib/dispatcher/client-h2.js +380 -1409
- package/node_modules/undici/lib/dispatcher/client.js +130 -253
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +52 -50
- package/node_modules/undici/lib/dispatcher/dispatcher.js +24 -17
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +45 -75
- package/node_modules/undici/lib/dispatcher/fixed-queue.js +50 -68
- package/node_modules/undici/lib/dispatcher/pool-base.js +54 -153
- package/node_modules/undici/lib/dispatcher/pool-stats.js +34 -0
- package/node_modules/undici/lib/dispatcher/pool.js +16 -135
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +41 -175
- package/node_modules/undici/lib/dispatcher/retry-agent.js +0 -3
- package/node_modules/undici/lib/global.js +9 -59
- package/node_modules/undici/lib/handler/decorator-handler.js +15 -43
- package/node_modules/undici/lib/handler/redirect-handler.js +116 -127
- package/node_modules/undici/lib/handler/retry-handler.js +182 -398
- package/node_modules/undici/lib/interceptor/dns.js +47 -254
- package/node_modules/undici/lib/interceptor/dump.js +56 -32
- package/node_modules/undici/lib/interceptor/redirect-interceptor.js +21 -0
- package/node_modules/undici/lib/interceptor/redirect.js +14 -11
- package/node_modules/undici/lib/interceptor/response-error.js +22 -31
- package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/undici/lib/llhttp/constants.js +193 -446
- package/node_modules/undici/lib/llhttp/llhttp-wasm.js +1 -11
- package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +1 -11
- package/node_modules/undici/lib/llhttp/utils.js +12 -9
- package/node_modules/undici/lib/mock/mock-agent.js +22 -106
- package/node_modules/undici/lib/mock/mock-client.js +4 -13
- package/node_modules/undici/lib/mock/mock-errors.js +2 -3
- package/node_modules/undici/lib/mock/mock-interceptor.js +13 -33
- package/node_modules/undici/lib/mock/mock-pool.js +4 -13
- package/node_modules/undici/lib/mock/mock-symbols.js +1 -10
- package/node_modules/undici/lib/mock/mock-utils.js +51 -404
- package/node_modules/undici/lib/mock/pluralizer.js +29 -0
- package/node_modules/undici/lib/util/timers.js +9 -11
- package/node_modules/undici/lib/web/cache/cache.js +51 -63
- package/node_modules/undici/lib/web/cache/cachestorage.js +7 -13
- package/node_modules/undici/lib/web/cache/symbols.js +5 -0
- package/node_modules/undici/lib/web/cookies/index.js +18 -45
- package/node_modules/undici/lib/web/cookies/parse.js +149 -157
- package/node_modules/undici/lib/web/cookies/util.js +2 -4
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +9 -37
- package/node_modules/undici/lib/web/eventsource/eventsource.js +64 -108
- package/node_modules/undici/lib/web/eventsource/util.js +5 -28
- package/node_modules/undici/lib/web/fetch/body.js +148 -173
- package/node_modules/undici/lib/web/fetch/constants.js +6 -13
- package/node_modules/undici/lib/web/fetch/data-url.js +167 -19
- package/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +46 -0
- package/node_modules/undici/lib/web/fetch/file.js +126 -0
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +117 -229
- package/node_modules/undici/lib/web/fetch/formdata.js +65 -85
- package/node_modules/undici/lib/web/fetch/headers.js +108 -143
- package/node_modules/undici/lib/web/fetch/index.js +446 -627
- package/node_modules/undici/lib/web/fetch/request.js +115 -217
- package/node_modules/undici/lib/web/fetch/response.js +82 -110
- package/node_modules/undici/lib/web/fetch/symbols.js +9 -0
- package/node_modules/undici/lib/web/fetch/util.js +393 -291
- package/node_modules/undici/lib/web/fetch/webidl.js +695 -0
- package/node_modules/undici/lib/web/fileapi/encoding.js +290 -0
- package/node_modules/undici/lib/web/fileapi/filereader.js +344 -0
- package/node_modules/undici/lib/web/fileapi/progressevent.js +78 -0
- package/node_modules/undici/lib/web/fileapi/symbols.js +10 -0
- package/node_modules/undici/lib/web/fileapi/util.js +391 -0
- package/node_modules/undici/lib/web/websocket/connection.js +160 -139
- package/node_modules/undici/lib/web/websocket/constants.js +10 -70
- package/node_modules/undici/lib/web/websocket/events.js +30 -49
- package/node_modules/undici/lib/web/websocket/frame.js +20 -51
- package/node_modules/undici/lib/web/websocket/receiver.js +87 -83
- package/node_modules/undici/lib/web/websocket/sender.js +13 -18
- package/node_modules/undici/lib/web/websocket/symbols.js +12 -0
- package/node_modules/undici/lib/web/websocket/util.js +90 -115
- package/node_modules/undici/lib/web/websocket/websocket.js +171 -359
- package/node_modules/undici/package.json +57 -49
- package/node_modules/undici/scripts/strip-comments.js +1 -3
- package/node_modules/undici/types/agent.d.ts +13 -12
- package/node_modules/undici/types/api.d.ts +26 -26
- package/node_modules/undici/types/balanced-pool.d.ts +12 -13
- package/node_modules/undici/types/client.d.ts +39 -98
- package/node_modules/undici/types/connector.d.ts +2 -5
- package/node_modules/undici/types/cookies.d.ts +1 -3
- package/node_modules/undici/types/diagnostics-channel.d.ts +11 -20
- package/node_modules/undici/types/dispatcher.d.ts +139 -136
- package/node_modules/undici/types/env-http-proxy-agent.d.ts +3 -4
- package/node_modules/undici/types/errors.d.ts +54 -86
- package/node_modules/undici/types/eventsource.d.ts +4 -9
- package/node_modules/undici/types/fetch.d.ts +25 -51
- package/node_modules/undici/types/file.d.ts +39 -0
- package/node_modules/undici/types/filereader.d.ts +54 -0
- package/node_modules/undici/types/formdata.d.ts +7 -7
- package/node_modules/undici/types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici/types/global-origin.d.ts +5 -5
- package/node_modules/undici/types/handlers.d.ts +9 -10
- package/node_modules/undici/types/header.d.ts +1 -162
- package/node_modules/undici/types/index.d.ts +47 -69
- package/node_modules/undici/types/interceptors.d.ts +12 -62
- package/node_modules/undici/types/mock-agent.d.ts +27 -46
- package/node_modules/undici/types/mock-client.d.ts +4 -6
- package/node_modules/undici/types/mock-errors.d.ts +3 -3
- package/node_modules/undici/types/mock-interceptor.d.ts +21 -26
- package/node_modules/undici/types/mock-pool.d.ts +4 -6
- package/node_modules/undici/types/patch.d.ts +4 -0
- package/node_modules/undici/types/pool-stats.d.ts +8 -8
- package/node_modules/undici/types/pool.d.ts +14 -14
- package/node_modules/undici/types/proxy-agent.d.ts +6 -13
- package/node_modules/undici/types/readable.d.ts +16 -19
- package/node_modules/undici/types/retry-agent.d.ts +1 -1
- package/node_modules/undici/types/retry-handler.d.ts +9 -18
- package/node_modules/undici/types/util.d.ts +3 -3
- package/node_modules/undici/types/webidl.d.ts +32 -156
- package/node_modules/undici/types/websocket.d.ts +10 -48
- package/node_modules/validate-npm-package-name/package.json +4 -4
- package/node_modules/which/package.json +4 -4
- package/node_modules/write-file-atomic/package.json +4 -4
- package/package.json +56 -60
- package/node_modules/@npmcli/arborist/lib/npm-extension.js +0 -237
- package/node_modules/@npmcli/arborist/lib/package-extensions.js +0 -236
- package/node_modules/@npmcli/arborist/lib/patch.js +0 -111
- package/node_modules/@npmcli/arborist/lib/patched-dependencies.js +0 -168
- package/node_modules/cacache/lib/util/cache-dir.js +0 -29
- package/node_modules/diff/CONTRIBUTING.md +0 -28
- package/node_modules/diff/LICENSE +0 -29
- package/node_modules/diff/README.md +0 -388
- package/node_modules/diff/dist/diff.js +0 -1782
- package/node_modules/diff/dist/diff.min.js +0 -1
- package/node_modules/diff/eslint.config.mjs +0 -182
- package/node_modules/diff/libcjs/convert/dmp.d.ts +0 -8
- package/node_modules/diff/libcjs/convert/dmp.d.ts.map +0 -1
- package/node_modules/diff/libcjs/convert/dmp.js +0 -24
- package/node_modules/diff/libcjs/convert/xml.d.ts +0 -6
- package/node_modules/diff/libcjs/convert/xml.d.ts.map +0 -1
- package/node_modules/diff/libcjs/convert/xml.js +0 -34
- package/node_modules/diff/libcjs/diff/array.d.ts +0 -19
- package/node_modules/diff/libcjs/diff/array.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/array.js +0 -40
- package/node_modules/diff/libcjs/diff/base.d.ts +0 -20
- package/node_modules/diff/libcjs/diff/base.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/base.js +0 -265
- package/node_modules/diff/libcjs/diff/character.d.ts +0 -19
- package/node_modules/diff/libcjs/diff/character.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/character.js +0 -31
- package/node_modules/diff/libcjs/diff/css.d.ts +0 -18
- package/node_modules/diff/libcjs/diff/css.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/css.js +0 -34
- package/node_modules/diff/libcjs/diff/json.d.ts +0 -24
- package/node_modules/diff/libcjs/diff/json.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/json.js +0 -105
- package/node_modules/diff/libcjs/diff/line.d.ts +0 -24
- package/node_modules/diff/libcjs/diff/line.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/line.js +0 -89
- package/node_modules/diff/libcjs/diff/sentence.d.ts +0 -21
- package/node_modules/diff/libcjs/diff/sentence.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/sentence.js +0 -67
- package/node_modules/diff/libcjs/diff/word.d.ts +0 -35
- package/node_modules/diff/libcjs/diff/word.d.ts.map +0 -1
- package/node_modules/diff/libcjs/diff/word.js +0 -312
- package/node_modules/diff/libcjs/index.d.ts +0 -20
- package/node_modules/diff/libcjs/index.d.ts.map +0 -1
- package/node_modules/diff/libcjs/index.js +0 -64
- package/node_modules/diff/libcjs/package.json +0 -1
- package/node_modules/diff/libcjs/patch/apply.d.ts +0 -62
- package/node_modules/diff/libcjs/patch/apply.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/apply.js +0 -267
- package/node_modules/diff/libcjs/patch/create.d.ts +0 -122
- package/node_modules/diff/libcjs/patch/create.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/create.js +0 -251
- package/node_modules/diff/libcjs/patch/line-endings.d.ts +0 -17
- package/node_modules/diff/libcjs/patch/line-endings.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/line-endings.js +0 -61
- package/node_modules/diff/libcjs/patch/parse.d.ts +0 -8
- package/node_modules/diff/libcjs/patch/parse.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/parse.js +0 -150
- package/node_modules/diff/libcjs/patch/reverse.d.ts +0 -9
- package/node_modules/diff/libcjs/patch/reverse.d.ts.map +0 -1
- package/node_modules/diff/libcjs/patch/reverse.js +0 -37
- package/node_modules/diff/libcjs/types.d.ts +0 -213
- package/node_modules/diff/libcjs/types.d.ts.map +0 -1
- package/node_modules/diff/libcjs/types.js +0 -2
- package/node_modules/diff/libcjs/util/array.d.ts +0 -3
- package/node_modules/diff/libcjs/util/array.d.ts.map +0 -1
- package/node_modules/diff/libcjs/util/array.js +0 -21
- package/node_modules/diff/libcjs/util/distance-iterator.d.ts +0 -2
- package/node_modules/diff/libcjs/util/distance-iterator.d.ts.map +0 -1
- package/node_modules/diff/libcjs/util/distance-iterator.js +0 -40
- package/node_modules/diff/libcjs/util/params.d.ts +0 -4
- package/node_modules/diff/libcjs/util/params.d.ts.map +0 -1
- package/node_modules/diff/libcjs/util/params.js +0 -17
- package/node_modules/diff/libcjs/util/string.d.ts +0 -30
- package/node_modules/diff/libcjs/util/string.d.ts.map +0 -1
- package/node_modules/diff/libcjs/util/string.js +0 -200
- package/node_modules/diff/libesm/convert/dmp.d.ts +0 -8
- package/node_modules/diff/libesm/convert/dmp.d.ts.map +0 -1
- package/node_modules/diff/libesm/convert/dmp.js +0 -21
- package/node_modules/diff/libesm/convert/xml.d.ts +0 -6
- package/node_modules/diff/libesm/convert/xml.d.ts.map +0 -1
- package/node_modules/diff/libesm/convert/xml.js +0 -31
- package/node_modules/diff/libesm/diff/array.d.ts +0 -19
- package/node_modules/diff/libesm/diff/array.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/array.js +0 -16
- package/node_modules/diff/libesm/diff/base.d.ts +0 -20
- package/node_modules/diff/libesm/diff/base.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/base.js +0 -253
- package/node_modules/diff/libesm/diff/character.d.ts +0 -19
- package/node_modules/diff/libesm/diff/character.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/character.js +0 -7
- package/node_modules/diff/libesm/diff/css.d.ts +0 -18
- package/node_modules/diff/libesm/diff/css.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/css.js +0 -10
- package/node_modules/diff/libesm/diff/json.d.ts +0 -24
- package/node_modules/diff/libesm/diff/json.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/json.js +0 -78
- package/node_modules/diff/libesm/diff/line.d.ts +0 -24
- package/node_modules/diff/libesm/diff/line.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/line.js +0 -65
- package/node_modules/diff/libesm/diff/sentence.d.ts +0 -21
- package/node_modules/diff/libesm/diff/sentence.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/sentence.js +0 -43
- package/node_modules/diff/libesm/diff/word.d.ts +0 -35
- package/node_modules/diff/libesm/diff/word.d.ts.map +0 -1
- package/node_modules/diff/libesm/diff/word.js +0 -281
- package/node_modules/diff/libesm/index.d.ts +0 -20
- package/node_modules/diff/libesm/index.d.ts.map +0 -1
- package/node_modules/diff/libesm/index.js +0 -30
- package/node_modules/diff/libesm/package.json +0 -1
- package/node_modules/diff/libesm/patch/apply.d.ts +0 -62
- package/node_modules/diff/libesm/patch/apply.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/apply.js +0 -257
- package/node_modules/diff/libesm/patch/create.d.ts +0 -122
- package/node_modules/diff/libesm/patch/create.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/create.js +0 -228
- package/node_modules/diff/libesm/patch/line-endings.d.ts +0 -17
- package/node_modules/diff/libesm/patch/line-endings.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/line-endings.js +0 -44
- package/node_modules/diff/libesm/patch/parse.d.ts +0 -8
- package/node_modules/diff/libesm/patch/parse.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/parse.js +0 -147
- package/node_modules/diff/libesm/patch/reverse.d.ts +0 -9
- package/node_modules/diff/libesm/patch/reverse.d.ts.map +0 -1
- package/node_modules/diff/libesm/patch/reverse.js +0 -23
- package/node_modules/diff/libesm/types.d.ts +0 -213
- package/node_modules/diff/libesm/types.d.ts.map +0 -1
- package/node_modules/diff/libesm/types.js +0 -1
- package/node_modules/diff/libesm/util/array.d.ts +0 -3
- package/node_modules/diff/libesm/util/array.d.ts.map +0 -1
- package/node_modules/diff/libesm/util/array.js +0 -17
- package/node_modules/diff/libesm/util/distance-iterator.d.ts +0 -2
- package/node_modules/diff/libesm/util/distance-iterator.d.ts.map +0 -1
- package/node_modules/diff/libesm/util/distance-iterator.js +0 -37
- package/node_modules/diff/libesm/util/params.d.ts +0 -4
- package/node_modules/diff/libesm/util/params.d.ts.map +0 -1
- package/node_modules/diff/libesm/util/params.js +0 -14
- package/node_modules/diff/libesm/util/string.d.ts +0 -30
- package/node_modules/diff/libesm/util/string.d.ts.map +0 -1
- package/node_modules/diff/libesm/util/string.js +0 -184
- package/node_modules/diff/package.json +0 -130
- package/node_modules/diff/release-notes.md +0 -432
- package/node_modules/node-gyp/commitlint.config.mjs +0 -3
- package/node_modules/node-gyp/gyp/commitlint.config.js +0 -6
- package/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake_test.py +0 -105
- package/node_modules/node-gyp/zizmor.yml +0 -5
- package/node_modules/proxy-agent-negotiate/dist/index.d.ts +0 -14
- package/node_modules/proxy-agent-negotiate/dist/index.d.ts.map +0 -1
- package/node_modules/proxy-agent-negotiate/dist/index.js +0 -35
- package/node_modules/proxy-agent-negotiate/dist/index.js.map +0 -1
- package/node_modules/proxy-agent-negotiate/package.json +0 -47
- package/node_modules/undici/docs/docs/api/CacheStore.md +0 -360
- package/node_modules/undici/docs/docs/api/ClientStats.md +0 -93
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +0 -121
- package/node_modules/undici/docs/docs/api/H2CClient.md +0 -385
- package/node_modules/undici/docs/docs/api/Interceptors.md +0 -419
- package/node_modules/undici/docs/docs/api/MockCallHistory.md +0 -371
- package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +0 -206
- package/node_modules/undici/docs/docs/api/RoundRobinPool.md +0 -239
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +0 -361
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +0 -256
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +0 -233
- package/node_modules/undici/docs/docs/getting-started.md +0 -281
- package/node_modules/undici/docs/docs/site.json +0 -125
- package/node_modules/undici/docs/docs/type-map.json +0 -79
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +0 -110
- package/node_modules/undici/types/dispatcher1-wrapper.d.ts +0 -7
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/core/socks5-client.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/core/socks5-utils.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/encoding/index.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/llhttp/constants.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/llhttp/utils.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/snapshot-utils.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/date.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/stats.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/subresource-integrity/Readme.md +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/subresource-integrity/subresource-integrity.js +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/cache-interceptor.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/client-stats.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/mock-call-history.d.ts +0 -0
- /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/utility.d.ts +0 -0
|
@@ -7,13 +7,13 @@ const {
|
|
|
7
7
|
makeAppropriateNetworkError,
|
|
8
8
|
filterResponse,
|
|
9
9
|
makeResponse,
|
|
10
|
-
fromInnerResponse
|
|
11
|
-
getResponseState
|
|
10
|
+
fromInnerResponse
|
|
12
11
|
} = require('./response')
|
|
13
12
|
const { HeadersList } = require('./headers')
|
|
14
|
-
const { Request, cloneRequest
|
|
13
|
+
const { Request, cloneRequest } = require('./request')
|
|
15
14
|
const zlib = require('node:zlib')
|
|
16
15
|
const {
|
|
16
|
+
bytesMatch,
|
|
17
17
|
makePolicyContainer,
|
|
18
18
|
clonePolicyContainer,
|
|
19
19
|
requestBadPort,
|
|
@@ -29,12 +29,15 @@ const {
|
|
|
29
29
|
crossOriginResourcePolicyCheck,
|
|
30
30
|
determineRequestsReferrer,
|
|
31
31
|
coarsenedSharedCurrentTime,
|
|
32
|
+
createDeferredPromise,
|
|
33
|
+
isBlobLike,
|
|
32
34
|
sameOrigin,
|
|
33
35
|
isCancelled,
|
|
34
36
|
isAborted,
|
|
35
37
|
isErrorLike,
|
|
36
38
|
fullyReadBody,
|
|
37
39
|
readableStreamClose,
|
|
40
|
+
isomorphicEncode,
|
|
38
41
|
urlIsLocal,
|
|
39
42
|
urlIsHttpHttpsScheme,
|
|
40
43
|
urlHasHttpsScheme,
|
|
@@ -42,11 +45,9 @@ const {
|
|
|
42
45
|
simpleRangeHeaderValue,
|
|
43
46
|
buildContentRange,
|
|
44
47
|
createInflate,
|
|
45
|
-
extractMimeType
|
|
46
|
-
hasAuthenticationEntry,
|
|
47
|
-
includesCredentials,
|
|
48
|
-
isTraversableNavigable
|
|
48
|
+
extractMimeType
|
|
49
49
|
} = require('./util')
|
|
50
|
+
const { kState, kDispatcher } = require('./symbols')
|
|
50
51
|
const assert = require('node:assert')
|
|
51
52
|
const { safelyExtractBody, extractBody } = require('./body')
|
|
52
53
|
const {
|
|
@@ -57,16 +58,12 @@ const {
|
|
|
57
58
|
subresourceSet
|
|
58
59
|
} = require('./constants')
|
|
59
60
|
const EE = require('node:events')
|
|
60
|
-
const { Readable, pipeline, finished
|
|
61
|
-
const { addAbortListener, bufferToLowerCasedHeaderName } = require('../../core/util')
|
|
62
|
-
const { SocketError } = require('../../core/errors')
|
|
61
|
+
const { Readable, pipeline, finished } = require('node:stream')
|
|
62
|
+
const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require('../../core/util')
|
|
63
63
|
const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')
|
|
64
64
|
const { getGlobalDispatcher } = require('../../global')
|
|
65
|
-
const { webidl } = require('
|
|
65
|
+
const { webidl } = require('./webidl')
|
|
66
66
|
const { STATUS_CODES } = require('node:http')
|
|
67
|
-
const { bytesMatch } = require('../subresource-integrity/subresource-integrity')
|
|
68
|
-
const { isomorphicEncode } = require('../infra')
|
|
69
|
-
|
|
70
67
|
const GET_OR_HEAD = ['GET', 'HEAD']
|
|
71
68
|
|
|
72
69
|
const defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'
|
|
@@ -76,35 +73,6 @@ const defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esb
|
|
|
76
73
|
/** @type {import('buffer').resolveObjectURL} */
|
|
77
74
|
let resolveObjectURL
|
|
78
75
|
|
|
79
|
-
function appendHeadersListFromResponseHeaders (headersList, headers, rawHeaders) {
|
|
80
|
-
if (Array.isArray(rawHeaders)) {
|
|
81
|
-
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
82
|
-
const nameStr = bufferToLowerCasedHeaderName(rawHeaders[i])
|
|
83
|
-
const value = rawHeaders[i + 1]
|
|
84
|
-
|
|
85
|
-
if (Array.isArray(value) && !Buffer.isBuffer(value)) {
|
|
86
|
-
for (const val of value) {
|
|
87
|
-
headersList.append(nameStr, val.toString('latin1'), true)
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
headersList.append(nameStr, value.toString('latin1'), true)
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
for (const [name, value] of Object.entries(headers ?? {})) {
|
|
98
|
-
if (Array.isArray(value)) {
|
|
99
|
-
for (const entry of value) {
|
|
100
|
-
headersList.append(name, `${entry}`, true)
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
headersList.append(name, `${value}`, true)
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
76
|
class Fetch extends EE {
|
|
109
77
|
constructor (dispatcher) {
|
|
110
78
|
super()
|
|
@@ -161,7 +129,7 @@ function fetch (input, init = undefined) {
|
|
|
161
129
|
webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')
|
|
162
130
|
|
|
163
131
|
// 1. Let p be a new promise.
|
|
164
|
-
let p =
|
|
132
|
+
let p = createDeferredPromise()
|
|
165
133
|
|
|
166
134
|
// 2. Let requestObject be the result of invoking the initial value of
|
|
167
135
|
// Request as constructor with input and init as arguments. If this throws
|
|
@@ -176,13 +144,13 @@ function fetch (input, init = undefined) {
|
|
|
176
144
|
}
|
|
177
145
|
|
|
178
146
|
// 3. Let request be requestObject’s request.
|
|
179
|
-
const request =
|
|
147
|
+
const request = requestObject[kState]
|
|
180
148
|
|
|
181
149
|
// 4. If requestObject’s signal’s aborted flag is set, then:
|
|
182
150
|
if (requestObject.signal.aborted) {
|
|
183
151
|
// 1. Abort the fetch() call with p, request, null, and
|
|
184
152
|
// requestObject’s signal’s abort reason.
|
|
185
|
-
abortFetch(p, request, null, requestObject.signal.reason
|
|
153
|
+
abortFetch(p, request, null, requestObject.signal.reason)
|
|
186
154
|
|
|
187
155
|
// 2. Return p.
|
|
188
156
|
return p.promise
|
|
@@ -209,7 +177,7 @@ function fetch (input, init = undefined) {
|
|
|
209
177
|
let controller = null
|
|
210
178
|
|
|
211
179
|
// 11. Add the following abort steps to requestObject’s signal:
|
|
212
|
-
|
|
180
|
+
addAbortListener(
|
|
213
181
|
requestObject.signal,
|
|
214
182
|
() => {
|
|
215
183
|
// 1. Set locallyAborted to true.
|
|
@@ -225,19 +193,10 @@ function fetch (input, init = undefined) {
|
|
|
225
193
|
|
|
226
194
|
// 4. Abort the fetch() call with p, request, responseObject,
|
|
227
195
|
// and requestObject’s signal’s abort reason.
|
|
228
|
-
abortFetch(p, request, realResponse, requestObject.signal.reason
|
|
196
|
+
abortFetch(p, request, realResponse, requestObject.signal.reason)
|
|
229
197
|
}
|
|
230
198
|
)
|
|
231
199
|
|
|
232
|
-
// Remove the `abort` listeners registered above and in the Request
|
|
233
|
-
// constructor once the fetch has settled. Without this, reusing a single
|
|
234
|
-
// signal across many requests leaks listeners and Node.js emits a
|
|
235
|
-
// MaxListenersExceededWarning. See https://github.com/nodejs/undici/issues/5285
|
|
236
|
-
const cleanupAbortListeners = () => {
|
|
237
|
-
removeAbortListener()
|
|
238
|
-
removeRequestAbortListener(requestObject)
|
|
239
|
-
}
|
|
240
|
-
|
|
241
200
|
// 12. Let handleFetchDone given response response be to finalize and
|
|
242
201
|
// report timing with response, globalObject, and "fetch".
|
|
243
202
|
// see function handleFetchDone
|
|
@@ -261,8 +220,7 @@ function fetch (input, init = undefined) {
|
|
|
261
220
|
// 2. Abort the fetch() call with p, request, responseObject, and
|
|
262
221
|
// deserializedError.
|
|
263
222
|
|
|
264
|
-
abortFetch(p, request, responseObject, controller.serializedAbortReason
|
|
265
|
-
cleanupAbortListeners()
|
|
223
|
+
abortFetch(p, request, responseObject, controller.serializedAbortReason)
|
|
266
224
|
return
|
|
267
225
|
}
|
|
268
226
|
|
|
@@ -270,7 +228,6 @@ function fetch (input, init = undefined) {
|
|
|
270
228
|
// and terminate these substeps.
|
|
271
229
|
if (response.type === 'error') {
|
|
272
230
|
p.reject(new TypeError('fetch failed', { cause: response.error }))
|
|
273
|
-
cleanupAbortListeners()
|
|
274
231
|
return
|
|
275
232
|
}
|
|
276
233
|
|
|
@@ -285,15 +242,9 @@ function fetch (input, init = undefined) {
|
|
|
285
242
|
|
|
286
243
|
controller = fetching({
|
|
287
244
|
request,
|
|
288
|
-
processResponseEndOfBody:
|
|
289
|
-
handleFetchDone(response)
|
|
290
|
-
cleanupAbortListeners()
|
|
291
|
-
},
|
|
245
|
+
processResponseEndOfBody: handleFetchDone,
|
|
292
246
|
processResponse,
|
|
293
|
-
dispatcher:
|
|
294
|
-
// Keep requestObject alive to prevent its AbortController from being GC'd
|
|
295
|
-
// See https://github.com/nodejs/undici/issues/4627
|
|
296
|
-
requestObject
|
|
247
|
+
dispatcher: requestObject[kDispatcher] // undici
|
|
297
248
|
})
|
|
298
249
|
|
|
299
250
|
// 14. Return p.
|
|
@@ -359,9 +310,7 @@ function finalizeAndReportTiming (response, initiatorType = 'other') {
|
|
|
359
310
|
originalURL.href,
|
|
360
311
|
initiatorType,
|
|
361
312
|
globalThis,
|
|
362
|
-
cacheState
|
|
363
|
-
'', // bodyType
|
|
364
|
-
response.status
|
|
313
|
+
cacheState
|
|
365
314
|
)
|
|
366
315
|
}
|
|
367
316
|
|
|
@@ -369,7 +318,7 @@ function finalizeAndReportTiming (response, initiatorType = 'other') {
|
|
|
369
318
|
const markResourceTiming = performance.markResourceTiming
|
|
370
319
|
|
|
371
320
|
// https://fetch.spec.whatwg.org/#abort-fetch
|
|
372
|
-
function abortFetch (p, request, responseObject, error
|
|
321
|
+
function abortFetch (p, request, responseObject, error) {
|
|
373
322
|
// 1. Reject promise with error.
|
|
374
323
|
if (p) {
|
|
375
324
|
// We might have already resolved the promise at this stage
|
|
@@ -378,7 +327,7 @@ function abortFetch (p, request, responseObject, error, controller /* undici-spe
|
|
|
378
327
|
|
|
379
328
|
// 2. If request’s body is not null and is readable, then cancel request’s
|
|
380
329
|
// body with error.
|
|
381
|
-
if (request.body
|
|
330
|
+
if (request.body != null && isReadable(request.body?.stream)) {
|
|
382
331
|
request.body.stream.cancel(error).catch((err) => {
|
|
383
332
|
if (err.code === 'ERR_INVALID_STATE') {
|
|
384
333
|
// Node bug?
|
|
@@ -394,12 +343,18 @@ function abortFetch (p, request, responseObject, error, controller /* undici-spe
|
|
|
394
343
|
}
|
|
395
344
|
|
|
396
345
|
// 4. Let response be responseObject’s response.
|
|
397
|
-
const response =
|
|
346
|
+
const response = responseObject[kState]
|
|
398
347
|
|
|
399
348
|
// 5. If response’s body is not null and is readable, then error response’s
|
|
400
349
|
// body with error.
|
|
401
|
-
if (response.body
|
|
402
|
-
|
|
350
|
+
if (response.body != null && isReadable(response.body?.stream)) {
|
|
351
|
+
response.body.stream.cancel(error).catch((err) => {
|
|
352
|
+
if (err.code === 'ERR_INVALID_STATE') {
|
|
353
|
+
// Node bug?
|
|
354
|
+
return
|
|
355
|
+
}
|
|
356
|
+
throw err
|
|
357
|
+
})
|
|
403
358
|
}
|
|
404
359
|
}
|
|
405
360
|
|
|
@@ -412,8 +367,7 @@ function fetching ({
|
|
|
412
367
|
processResponseEndOfBody,
|
|
413
368
|
processResponseConsumeBody,
|
|
414
369
|
useParallelQueue = false,
|
|
415
|
-
dispatcher = getGlobalDispatcher()
|
|
416
|
-
requestObject = null // Keep alive to prevent AbortController GC, see #4627
|
|
370
|
+
dispatcher = getGlobalDispatcher() // undici
|
|
417
371
|
}) {
|
|
418
372
|
// Ensure that the dispatcher is set accordingly
|
|
419
373
|
assert(dispatcher)
|
|
@@ -467,9 +421,7 @@ function fetching ({
|
|
|
467
421
|
processResponseConsumeBody,
|
|
468
422
|
processResponseEndOfBody,
|
|
469
423
|
taskDestination,
|
|
470
|
-
crossOriginIsolatedCapability
|
|
471
|
-
// Keep requestObject alive to prevent its AbortController from being GC'd
|
|
472
|
-
requestObject
|
|
424
|
+
crossOriginIsolatedCapability
|
|
473
425
|
}
|
|
474
426
|
|
|
475
427
|
// 7. If request’s body is a byte sequence, then set request’s body to
|
|
@@ -554,71 +506,75 @@ function fetching ({
|
|
|
554
506
|
}
|
|
555
507
|
|
|
556
508
|
// 16. Run main fetch given fetchParams.
|
|
557
|
-
mainFetch(fetchParams
|
|
509
|
+
mainFetch(fetchParams)
|
|
510
|
+
.catch(err => {
|
|
511
|
+
fetchParams.controller.terminate(err)
|
|
512
|
+
})
|
|
558
513
|
|
|
559
514
|
// 17. Return fetchParam's controller
|
|
560
515
|
return fetchParams.controller
|
|
561
516
|
}
|
|
562
517
|
|
|
563
518
|
// https://fetch.spec.whatwg.org/#concept-main-fetch
|
|
564
|
-
async function mainFetch (fetchParams, recursive) {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
const request = fetchParams.request
|
|
519
|
+
async function mainFetch (fetchParams, recursive = false) {
|
|
520
|
+
// 1. Let request be fetchParams’s request.
|
|
521
|
+
const request = fetchParams.request
|
|
568
522
|
|
|
569
|
-
|
|
570
|
-
|
|
523
|
+
// 2. Let response be null.
|
|
524
|
+
let response = null
|
|
571
525
|
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
526
|
+
// 3. If request’s local-URLs-only flag is set and request’s current URL is
|
|
527
|
+
// not local, then set response to a network error.
|
|
528
|
+
if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
|
|
529
|
+
response = makeNetworkError('local URLs only')
|
|
530
|
+
}
|
|
577
531
|
|
|
578
|
-
|
|
579
|
-
|
|
532
|
+
// 4. Run report Content Security Policy violations for request.
|
|
533
|
+
// TODO
|
|
580
534
|
|
|
581
|
-
|
|
582
|
-
|
|
535
|
+
// 5. Upgrade request to a potentially trustworthy URL, if appropriate.
|
|
536
|
+
tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
|
|
583
537
|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
538
|
+
// 6. If should request be blocked due to a bad port, should fetching request
|
|
539
|
+
// be blocked as mixed content, or should request be blocked by Content
|
|
540
|
+
// Security Policy returns blocked, then set response to a network error.
|
|
541
|
+
if (requestBadPort(request) === 'blocked') {
|
|
542
|
+
response = makeNetworkError('bad port')
|
|
543
|
+
}
|
|
544
|
+
// TODO: should fetching request be blocked as mixed content?
|
|
545
|
+
// TODO: should request be blocked by Content Security Policy?
|
|
592
546
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
547
|
+
// 7. If request’s referrer policy is the empty string, then set request’s
|
|
548
|
+
// referrer policy to request’s policy container’s referrer policy.
|
|
549
|
+
if (request.referrerPolicy === '') {
|
|
550
|
+
request.referrerPolicy = request.policyContainer.referrerPolicy
|
|
551
|
+
}
|
|
598
552
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
553
|
+
// 8. If request’s referrer is not "no-referrer", then set request’s
|
|
554
|
+
// referrer to the result of invoking determine request’s referrer.
|
|
555
|
+
if (request.referrer !== 'no-referrer') {
|
|
556
|
+
request.referrer = determineRequestsReferrer(request)
|
|
557
|
+
}
|
|
604
558
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
559
|
+
// 9. Set request’s current URL’s scheme to "https" if all of the following
|
|
560
|
+
// conditions are true:
|
|
561
|
+
// - request’s current URL’s scheme is "http"
|
|
562
|
+
// - request’s current URL’s host is a domain
|
|
563
|
+
// - Matching request’s current URL’s host per Known HSTS Host Domain Name
|
|
564
|
+
// Matching results in either a superdomain match with an asserted
|
|
565
|
+
// includeSubDomains directive or a congruent match (with or without an
|
|
566
|
+
// asserted includeSubDomains directive). [HSTS]
|
|
567
|
+
// TODO
|
|
614
568
|
|
|
615
|
-
|
|
616
|
-
|
|
569
|
+
// 10. If recursive is false, then run the remaining steps in parallel.
|
|
570
|
+
// TODO
|
|
617
571
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
572
|
+
// 11. If response is null, then set response to the result of running
|
|
573
|
+
// the steps corresponding to the first matching statement:
|
|
574
|
+
if (response === null) {
|
|
575
|
+
response = await (async () => {
|
|
621
576
|
const currentURL = requestCurrentURL(request)
|
|
577
|
+
|
|
622
578
|
if (
|
|
623
579
|
// - request’s current URL’s origin is same origin with request’s origin,
|
|
624
580
|
// and request’s response tainting is "basic"
|
|
@@ -632,188 +588,192 @@ async function mainFetch (fetchParams, recursive) {
|
|
|
632
588
|
request.responseTainting = 'basic'
|
|
633
589
|
|
|
634
590
|
// 2. Return the result of running scheme fetch given fetchParams.
|
|
635
|
-
|
|
591
|
+
return await schemeFetch(fetchParams)
|
|
592
|
+
}
|
|
636
593
|
|
|
637
594
|
// request’s mode is "same-origin"
|
|
638
|
-
|
|
595
|
+
if (request.mode === 'same-origin') {
|
|
639
596
|
// 1. Return a network error.
|
|
640
|
-
|
|
597
|
+
return makeNetworkError('request mode cannot be "same-origin"')
|
|
598
|
+
}
|
|
641
599
|
|
|
642
600
|
// request’s mode is "no-cors"
|
|
643
|
-
|
|
601
|
+
if (request.mode === 'no-cors') {
|
|
644
602
|
// 1. If request’s redirect mode is not "follow", then return a network
|
|
645
603
|
// error.
|
|
646
604
|
if (request.redirect !== 'follow') {
|
|
647
|
-
|
|
605
|
+
return makeNetworkError(
|
|
648
606
|
'redirect mode cannot be "follow" for "no-cors" request'
|
|
649
607
|
)
|
|
650
|
-
} else {
|
|
651
|
-
// 2. Set request’s response tainting to "opaque".
|
|
652
|
-
request.responseTainting = 'opaque'
|
|
653
|
-
|
|
654
|
-
// 3. Return the result of running scheme fetch given fetchParams.
|
|
655
|
-
response = await schemeFetch(fetchParams)
|
|
656
608
|
}
|
|
609
|
+
|
|
610
|
+
// 2. Set request’s response tainting to "opaque".
|
|
611
|
+
request.responseTainting = 'opaque'
|
|
612
|
+
|
|
613
|
+
// 3. Return the result of running scheme fetch given fetchParams.
|
|
614
|
+
return await schemeFetch(fetchParams)
|
|
615
|
+
}
|
|
616
|
+
|
|
657
617
|
// request’s current URL’s scheme is not an HTTP(S) scheme
|
|
658
|
-
|
|
618
|
+
if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
|
|
659
619
|
// Return a network error.
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
620
|
+
return makeNetworkError('URL scheme must be a HTTP(S) scheme')
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
// - request’s use-CORS-preflight flag is set
|
|
624
|
+
// - request’s unsafe-request flag is set and either request’s method is
|
|
625
|
+
// not a CORS-safelisted method or CORS-unsafe request-header names with
|
|
626
|
+
// request’s header list is not empty
|
|
627
|
+
// 1. Set request’s response tainting to "cors".
|
|
628
|
+
// 2. Let corsWithPreflightResponse be the result of running HTTP fetch
|
|
629
|
+
// given fetchParams and true.
|
|
630
|
+
// 3. If corsWithPreflightResponse is a network error, then clear cache
|
|
631
|
+
// entries using request.
|
|
632
|
+
// 4. Return corsWithPreflightResponse.
|
|
633
|
+
// TODO
|
|
673
634
|
|
|
674
635
|
// Otherwise
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
request.responseTainting = 'cors'
|
|
636
|
+
// 1. Set request’s response tainting to "cors".
|
|
637
|
+
request.responseTainting = 'cors'
|
|
678
638
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
639
|
+
// 2. Return the result of running HTTP fetch given fetchParams.
|
|
640
|
+
return await httpFetch(fetchParams)
|
|
641
|
+
})()
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// 12. If recursive is true, then return response.
|
|
645
|
+
if (recursive) {
|
|
646
|
+
return response
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// 13. If response is not a network error and response is not a filtered
|
|
650
|
+
// response, then:
|
|
651
|
+
if (response.status !== 0 && !response.internalResponse) {
|
|
652
|
+
// If request’s response tainting is "cors", then:
|
|
653
|
+
if (request.responseTainting === 'cors') {
|
|
654
|
+
// 1. Let headerNames be the result of extracting header list values
|
|
655
|
+
// given `Access-Control-Expose-Headers` and response’s header list.
|
|
656
|
+
// TODO
|
|
657
|
+
// 2. If request’s credentials mode is not "include" and headerNames
|
|
658
|
+
// contains `*`, then set response’s CORS-exposed header-name list to
|
|
659
|
+
// all unique header names in response’s header list.
|
|
660
|
+
// TODO
|
|
661
|
+
// 3. Otherwise, if headerNames is not null or failure, then set
|
|
662
|
+
// response’s CORS-exposed header-name list to headerNames.
|
|
663
|
+
// TODO
|
|
682
664
|
}
|
|
683
665
|
|
|
684
|
-
//
|
|
685
|
-
|
|
686
|
-
|
|
666
|
+
// Set response to the following filtered response with response as its
|
|
667
|
+
// internal response, depending on request’s response tainting:
|
|
668
|
+
if (request.responseTainting === 'basic') {
|
|
669
|
+
response = filterResponse(response, 'basic')
|
|
670
|
+
} else if (request.responseTainting === 'cors') {
|
|
671
|
+
response = filterResponse(response, 'cors')
|
|
672
|
+
} else if (request.responseTainting === 'opaque') {
|
|
673
|
+
response = filterResponse(response, 'opaque')
|
|
674
|
+
} else {
|
|
675
|
+
assert(false)
|
|
687
676
|
}
|
|
677
|
+
}
|
|
688
678
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
if (request.responseTainting === 'cors') {
|
|
694
|
-
// 1. Let headerNames be the result of extracting header list values
|
|
695
|
-
// given `Access-Control-Expose-Headers` and response’s header list.
|
|
696
|
-
// TODO
|
|
697
|
-
// 2. If request’s credentials mode is not "include" and headerNames
|
|
698
|
-
// contains `*`, then set response’s CORS-exposed header-name list to
|
|
699
|
-
// all unique header names in response’s header list.
|
|
700
|
-
// TODO
|
|
701
|
-
// 3. Otherwise, if headerNames is not null or failure, then set
|
|
702
|
-
// response’s CORS-exposed header-name list to headerNames.
|
|
703
|
-
// TODO
|
|
704
|
-
}
|
|
679
|
+
// 14. Let internalResponse be response, if response is a network error,
|
|
680
|
+
// and response’s internal response otherwise.
|
|
681
|
+
let internalResponse =
|
|
682
|
+
response.status === 0 ? response : response.internalResponse
|
|
705
683
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
response = filterResponse(response, 'cors')
|
|
712
|
-
} else if (request.responseTainting === 'opaque') {
|
|
713
|
-
response = filterResponse(response, 'opaque')
|
|
714
|
-
} else {
|
|
715
|
-
assert(false)
|
|
716
|
-
}
|
|
717
|
-
}
|
|
684
|
+
// 15. If internalResponse’s URL list is empty, then set it to a clone of
|
|
685
|
+
// request’s URL list.
|
|
686
|
+
if (internalResponse.urlList.length === 0) {
|
|
687
|
+
internalResponse.urlList.push(...request.urlList)
|
|
688
|
+
}
|
|
718
689
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
690
|
+
// 16. If request’s timing allow failed flag is unset, then set
|
|
691
|
+
// internalResponse’s timing allow passed flag.
|
|
692
|
+
if (!request.timingAllowFailed) {
|
|
693
|
+
response.timingAllowPassed = true
|
|
694
|
+
}
|
|
723
695
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
696
|
+
// 17. If response is not a network error and any of the following returns
|
|
697
|
+
// blocked
|
|
698
|
+
// - should internalResponse to request be blocked as mixed content
|
|
699
|
+
// - should internalResponse to request be blocked by Content Security Policy
|
|
700
|
+
// - should internalResponse to request be blocked due to its MIME type
|
|
701
|
+
// - should internalResponse to request be blocked due to nosniff
|
|
702
|
+
// TODO
|
|
729
703
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
704
|
+
// 18. If response’s type is "opaque", internalResponse’s status is 206,
|
|
705
|
+
// internalResponse’s range-requested flag is set, and request’s header
|
|
706
|
+
// list does not contain `Range`, then set response and internalResponse
|
|
707
|
+
// to a network error.
|
|
708
|
+
if (
|
|
709
|
+
response.type === 'opaque' &&
|
|
710
|
+
internalResponse.status === 206 &&
|
|
711
|
+
internalResponse.rangeRequested &&
|
|
712
|
+
!request.headers.contains('range', true)
|
|
713
|
+
) {
|
|
714
|
+
response = internalResponse = makeNetworkError()
|
|
715
|
+
}
|
|
735
716
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
717
|
+
// 19. If response is not a network error and either request’s method is
|
|
718
|
+
// `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
|
|
719
|
+
// set internalResponse’s body to null and disregard any enqueuing toward
|
|
720
|
+
// it (if any).
|
|
721
|
+
if (
|
|
722
|
+
response.status !== 0 &&
|
|
723
|
+
(request.method === 'HEAD' ||
|
|
724
|
+
request.method === 'CONNECT' ||
|
|
725
|
+
nullBodyStatus.includes(internalResponse.status))
|
|
726
|
+
) {
|
|
727
|
+
internalResponse.body = null
|
|
728
|
+
fetchParams.controller.dump = true
|
|
729
|
+
}
|
|
743
730
|
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
//
|
|
747
|
-
//
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
internalResponse.status === 206 &&
|
|
751
|
-
internalResponse.rangeRequested &&
|
|
752
|
-
!request.headers.contains('range', true)
|
|
753
|
-
) {
|
|
754
|
-
response = internalResponse = makeNetworkError()
|
|
755
|
-
}
|
|
731
|
+
// 20. If request’s integrity metadata is not the empty string, then:
|
|
732
|
+
if (request.integrity) {
|
|
733
|
+
// 1. Let processBodyError be this step: run fetch finale given fetchParams
|
|
734
|
+
// and a network error.
|
|
735
|
+
const processBodyError = (reason) =>
|
|
736
|
+
fetchFinale(fetchParams, makeNetworkError(reason))
|
|
756
737
|
|
|
757
|
-
//
|
|
758
|
-
//
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
response.status !== 0 &&
|
|
763
|
-
(request.method === 'HEAD' ||
|
|
764
|
-
request.method === 'CONNECT' ||
|
|
765
|
-
nullBodyStatus.includes(internalResponse.status))
|
|
766
|
-
) {
|
|
767
|
-
internalResponse.body = null
|
|
768
|
-
fetchParams.controller.dump = true
|
|
738
|
+
// 2. If request’s response tainting is "opaque", or response’s body is null,
|
|
739
|
+
// then run processBodyError and abort these steps.
|
|
740
|
+
if (request.responseTainting === 'opaque' || response.body == null) {
|
|
741
|
+
processBodyError(response.error)
|
|
742
|
+
return
|
|
769
743
|
}
|
|
770
744
|
|
|
771
|
-
//
|
|
772
|
-
|
|
773
|
-
// 1.
|
|
774
|
-
// and
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
// 2. If request’s response tainting is "opaque", or response’s body is null,
|
|
779
|
-
// then run processBodyError and abort these steps.
|
|
780
|
-
if (request.responseTainting === 'opaque' || response.body == null) {
|
|
781
|
-
processBodyError(response.error)
|
|
745
|
+
// 3. Let processBody given bytes be these steps:
|
|
746
|
+
const processBody = (bytes) => {
|
|
747
|
+
// 1. If bytes do not match request’s integrity metadata,
|
|
748
|
+
// then run processBodyError and abort these steps. [SRI]
|
|
749
|
+
if (!bytesMatch(bytes, request.integrity)) {
|
|
750
|
+
processBodyError('integrity mismatch')
|
|
782
751
|
return
|
|
783
752
|
}
|
|
784
753
|
|
|
785
|
-
//
|
|
786
|
-
|
|
787
|
-
// 1. If bytes do not match request’s integrity metadata,
|
|
788
|
-
// then run processBodyError and abort these steps. [SRI]
|
|
789
|
-
if (!bytesMatch(bytes, request.integrity)) {
|
|
790
|
-
processBodyError('integrity mismatch')
|
|
791
|
-
return
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
// 2. Set response’s body to bytes as a body.
|
|
795
|
-
response.body = safelyExtractBody(bytes)[0]
|
|
796
|
-
|
|
797
|
-
// 3. Run fetch finale given fetchParams and response.
|
|
798
|
-
fetchFinale(fetchParams, response)
|
|
799
|
-
}
|
|
754
|
+
// 2. Set response’s body to bytes as a body.
|
|
755
|
+
response.body = safelyExtractBody(bytes)[0]
|
|
800
756
|
|
|
801
|
-
//
|
|
802
|
-
fullyReadBody(response.body, processBody, processBodyError)
|
|
803
|
-
} else {
|
|
804
|
-
// 21. Otherwise, run fetch finale given fetchParams and response.
|
|
757
|
+
// 3. Run fetch finale given fetchParams and response.
|
|
805
758
|
fetchFinale(fetchParams, response)
|
|
806
759
|
}
|
|
807
|
-
|
|
808
|
-
|
|
760
|
+
|
|
761
|
+
// 4. Fully read response’s body given processBody and processBodyError.
|
|
762
|
+
await fullyReadBody(response.body, processBody, processBodyError)
|
|
763
|
+
} else {
|
|
764
|
+
// 21. Otherwise, run fetch finale given fetchParams and response.
|
|
765
|
+
fetchFinale(fetchParams, response)
|
|
809
766
|
}
|
|
810
767
|
}
|
|
811
768
|
|
|
812
769
|
// https://fetch.spec.whatwg.org/#concept-scheme-fetch
|
|
813
770
|
// given a fetch params fetchParams
|
|
814
771
|
function schemeFetch (fetchParams) {
|
|
772
|
+
// Note: since the connection is destroyed on redirect, which sets fetchParams to a
|
|
773
|
+
// cancelled state, we do not want this condition to trigger *unless* there have been
|
|
774
|
+
// no redirects. See https://github.com/nodejs/undici/issues/1776
|
|
815
775
|
// 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
|
|
816
|
-
if (isCancelled(fetchParams)) {
|
|
776
|
+
if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
|
|
817
777
|
return Promise.resolve(makeAppropriateNetworkError(fetchParams))
|
|
818
778
|
}
|
|
819
779
|
|
|
@@ -850,7 +810,7 @@ function schemeFetch (fetchParams) {
|
|
|
850
810
|
|
|
851
811
|
// 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
|
|
852
812
|
// object is not a Blob object, then return a network error.
|
|
853
|
-
if (request.method !== 'GET' || !
|
|
813
|
+
if (request.method !== 'GET' || !isBlobLike(blob)) {
|
|
854
814
|
return Promise.resolve(makeNetworkError('invalid method'))
|
|
855
815
|
}
|
|
856
816
|
|
|
@@ -928,7 +888,7 @@ function schemeFetch (fetchParams) {
|
|
|
928
888
|
|
|
929
889
|
// 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,
|
|
930
890
|
// rangeEnd + 1, and type.
|
|
931
|
-
const slicedBlob = blob.slice(rangeStart, rangeEnd
|
|
891
|
+
const slicedBlob = blob.slice(rangeStart, rangeEnd, type)
|
|
932
892
|
|
|
933
893
|
// 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.
|
|
934
894
|
// Note: same reason as mentioned above as to why we use extractBody
|
|
@@ -1027,21 +987,21 @@ function fetchFinale (fetchParams, response) {
|
|
|
1027
987
|
// `Server-Timing` from response’s internal response’s header list.
|
|
1028
988
|
// TODO
|
|
1029
989
|
|
|
1030
|
-
// 3.
|
|
1031
|
-
// full timing info to fetchParams’s timing info.
|
|
1032
|
-
if (fetchParams.request.destination === 'document') {
|
|
1033
|
-
fetchParams.controller.fullTimingInfo = timingInfo
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
// 4. Let processResponseEndOfBody be the following steps:
|
|
990
|
+
// 3. Let processResponseEndOfBody be the following steps:
|
|
1037
991
|
const processResponseEndOfBody = () => {
|
|
1038
992
|
// 1. Let unsafeEndTime be the unsafe shared current time.
|
|
1039
993
|
const unsafeEndTime = Date.now() // ?
|
|
1040
994
|
|
|
1041
|
-
// 2.
|
|
995
|
+
// 2. If fetchParams’s request’s destination is "document", then set fetchParams’s controller’s
|
|
996
|
+
// full timing info to fetchParams’s timing info.
|
|
997
|
+
if (fetchParams.request.destination === 'document') {
|
|
998
|
+
fetchParams.controller.fullTimingInfo = timingInfo
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
// 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:
|
|
1042
1002
|
fetchParams.controller.reportTimingSteps = () => {
|
|
1043
1003
|
// 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.
|
|
1044
|
-
if (
|
|
1004
|
+
if (fetchParams.request.url.protocol !== 'https:') {
|
|
1045
1005
|
return
|
|
1046
1006
|
}
|
|
1047
1007
|
|
|
@@ -1066,7 +1026,7 @@ function fetchFinale (fetchParams, response) {
|
|
|
1066
1026
|
let responseStatus = 0
|
|
1067
1027
|
|
|
1068
1028
|
// 7. If fetchParams’s request’s mode is not "navigate" or response’s has-cross-origin-redirects is false:
|
|
1069
|
-
if (fetchParams.request.mode !== '
|
|
1029
|
+
if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {
|
|
1070
1030
|
// 1. Set responseStatus to response’s status.
|
|
1071
1031
|
responseStatus = response.status
|
|
1072
1032
|
|
|
@@ -1083,11 +1043,12 @@ function fetchFinale (fetchParams, response) {
|
|
|
1083
1043
|
// fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,
|
|
1084
1044
|
// and responseStatus.
|
|
1085
1045
|
if (fetchParams.request.initiatorType != null) {
|
|
1046
|
+
// TODO: update markresourcetiming
|
|
1086
1047
|
markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)
|
|
1087
1048
|
}
|
|
1088
1049
|
}
|
|
1089
1050
|
|
|
1090
|
-
//
|
|
1051
|
+
// 4. Let processResponseEndOfBodyTask be the following steps:
|
|
1091
1052
|
const processResponseEndOfBodyTask = () => {
|
|
1092
1053
|
// 1. Set fetchParams’s request’s done flag.
|
|
1093
1054
|
fetchParams.request.done = true
|
|
@@ -1106,11 +1067,11 @@ function fetchFinale (fetchParams, response) {
|
|
|
1106
1067
|
}
|
|
1107
1068
|
}
|
|
1108
1069
|
|
|
1109
|
-
//
|
|
1070
|
+
// 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination
|
|
1110
1071
|
queueMicrotask(() => processResponseEndOfBodyTask())
|
|
1111
1072
|
}
|
|
1112
1073
|
|
|
1113
|
-
//
|
|
1074
|
+
// 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s
|
|
1114
1075
|
// process response given response, with fetchParams’s task destination.
|
|
1115
1076
|
if (fetchParams.processResponse != null) {
|
|
1116
1077
|
queueMicrotask(() => {
|
|
@@ -1119,14 +1080,11 @@ function fetchFinale (fetchParams, response) {
|
|
|
1119
1080
|
})
|
|
1120
1081
|
}
|
|
1121
1082
|
|
|
1122
|
-
//
|
|
1083
|
+
// 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.
|
|
1123
1084
|
const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)
|
|
1124
1085
|
|
|
1125
|
-
//
|
|
1126
|
-
//
|
|
1127
|
-
|
|
1128
|
-
// 8. If internalResponse’s body is null, then run processResponseEndOfBody.
|
|
1129
|
-
// 9. Otherwise:
|
|
1086
|
+
// 6. If internalResponse’s body is null, then run processResponseEndOfBody.
|
|
1087
|
+
// 7. Otherwise:
|
|
1130
1088
|
if (internalResponse.body == null) {
|
|
1131
1089
|
processResponseEndOfBody()
|
|
1132
1090
|
} else {
|
|
@@ -1144,27 +1102,6 @@ function fetchFinale (fetchParams, response) {
|
|
|
1144
1102
|
processResponseEndOfBody()
|
|
1145
1103
|
})
|
|
1146
1104
|
}
|
|
1147
|
-
|
|
1148
|
-
// 10. If fetchParams’s process response consume body is non-null, then:
|
|
1149
|
-
if (fetchParams.processResponseConsumeBody != null) {
|
|
1150
|
-
// 1. Let processBody given nullOrBytes be this step: run fetchParams’s
|
|
1151
|
-
// process response consume body given response and nullOrBytes.
|
|
1152
|
-
const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
|
|
1153
|
-
|
|
1154
|
-
// 2. Let processBodyError be this step: run fetchParams’s process
|
|
1155
|
-
// response consume body given response and failure.
|
|
1156
|
-
const processBodyError = () => fetchParams.processResponseConsumeBody(response, 'failure')
|
|
1157
|
-
|
|
1158
|
-
// 3. If internalResponse’s body is null, then queue a fetch task to run
|
|
1159
|
-
// processBody given null, with fetchParams’s task destination.
|
|
1160
|
-
if (internalResponse.body == null) {
|
|
1161
|
-
queueMicrotask(() => processBody(null))
|
|
1162
|
-
} else {
|
|
1163
|
-
// 4. Otherwise, fully read internalResponse’s body given processBody,
|
|
1164
|
-
// processBodyError, and fetchParams’s task destination.
|
|
1165
|
-
fullyReadBody(internalResponse.body, processBody, processBodyError)
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
1105
|
}
|
|
1169
1106
|
|
|
1170
1107
|
// https://fetch.spec.whatwg.org/#http-fetch
|
|
@@ -1240,7 +1177,7 @@ async function httpFetch (fetchParams) {
|
|
|
1240
1177
|
// encouraged to, transmit an RST_STREAM frame.
|
|
1241
1178
|
// See, https://github.com/whatwg/fetch/issues/1288
|
|
1242
1179
|
if (request.redirect !== 'manual') {
|
|
1243
|
-
fetchParams.controller.connection.destroy()
|
|
1180
|
+
fetchParams.controller.connection.destroy(undefined, false)
|
|
1244
1181
|
}
|
|
1245
1182
|
|
|
1246
1183
|
// 2. Switch on request’s redirect mode:
|
|
@@ -1381,8 +1318,8 @@ function httpRedirectFetch (fetchParams, response) {
|
|
|
1381
1318
|
request.headersList.delete('host', true)
|
|
1382
1319
|
}
|
|
1383
1320
|
|
|
1384
|
-
// 14. If request
|
|
1385
|
-
// value of safely extracting request
|
|
1321
|
+
// 14. If request’s body is non-null, then set request’s body to the first return
|
|
1322
|
+
// value of safely extracting request’s body’s source.
|
|
1386
1323
|
if (request.body != null) {
|
|
1387
1324
|
assert(request.body.source != null)
|
|
1388
1325
|
request.body = safelyExtractBody(request.body.source)[0]
|
|
@@ -1453,16 +1390,7 @@ async function httpNetworkOrCacheFetch (
|
|
|
1453
1390
|
// Otherwise:
|
|
1454
1391
|
|
|
1455
1392
|
// 1. Set httpRequest to a clone of request.
|
|
1456
|
-
|
|
1457
|
-
// when request’s body’s source is null as only a single body is needed in
|
|
1458
|
-
// that case. E.g., when request’s body’s source is null, redirects and
|
|
1459
|
-
// authentication will end up failing the fetch.
|
|
1460
|
-
if (request.body?.source != null) {
|
|
1461
|
-
httpRequest = cloneRequest(request)
|
|
1462
|
-
} else {
|
|
1463
|
-
httpRequest = cloneRequest({ ...request, body: null })
|
|
1464
|
-
httpRequest.body = request.body
|
|
1465
|
-
}
|
|
1393
|
+
httpRequest = cloneRequest(request)
|
|
1466
1394
|
|
|
1467
1395
|
// 2. Set httpFetchParams to a copy of fetchParams.
|
|
1468
1396
|
httpFetchParams = { ...fetchParams }
|
|
@@ -1502,10 +1430,7 @@ async function httpNetworkOrCacheFetch (
|
|
|
1502
1430
|
// 8. If contentLengthHeaderValue is non-null, then append
|
|
1503
1431
|
// `Content-Length`/contentLengthHeaderValue to httpRequest’s header
|
|
1504
1432
|
// list.
|
|
1505
|
-
if (
|
|
1506
|
-
contentLengthHeaderValue != null &&
|
|
1507
|
-
!httpRequest.headersList.contains('content-length', true)
|
|
1508
|
-
) {
|
|
1433
|
+
if (contentLengthHeaderValue != null) {
|
|
1509
1434
|
httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)
|
|
1510
1435
|
}
|
|
1511
1436
|
|
|
@@ -1521,7 +1446,7 @@ async function httpNetworkOrCacheFetch (
|
|
|
1521
1446
|
// 11. If httpRequest’s referrer is a URL, then append
|
|
1522
1447
|
// `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
|
|
1523
1448
|
// to httpRequest’s header list.
|
|
1524
|
-
if (
|
|
1449
|
+
if (httpRequest.referrer instanceof URL) {
|
|
1525
1450
|
httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)
|
|
1526
1451
|
}
|
|
1527
1452
|
|
|
@@ -1535,7 +1460,7 @@ async function httpNetworkOrCacheFetch (
|
|
|
1535
1460
|
// user agents should append `User-Agent`/default `User-Agent` value to
|
|
1536
1461
|
// httpRequest’s header list.
|
|
1537
1462
|
if (!httpRequest.headersList.contains('user-agent', true)) {
|
|
1538
|
-
httpRequest.headersList.append('user-agent', defaultUserAgent
|
|
1463
|
+
httpRequest.headersList.append('user-agent', defaultUserAgent)
|
|
1539
1464
|
}
|
|
1540
1465
|
|
|
1541
1466
|
// 15. If httpRequest’s cache mode is "default" and httpRequest’s header
|
|
@@ -1591,7 +1516,7 @@ async function httpNetworkOrCacheFetch (
|
|
|
1591
1516
|
// TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
|
|
1592
1517
|
if (!httpRequest.headersList.contains('accept-encoding', true)) {
|
|
1593
1518
|
if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
|
|
1594
|
-
httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate
|
|
1519
|
+
httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)
|
|
1595
1520
|
} else {
|
|
1596
1521
|
httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)
|
|
1597
1522
|
}
|
|
@@ -1599,39 +1524,13 @@ async function httpNetworkOrCacheFetch (
|
|
|
1599
1524
|
|
|
1600
1525
|
httpRequest.headersList.delete('host', true)
|
|
1601
1526
|
|
|
1602
|
-
//
|
|
1527
|
+
// 20. If includeCredentials is true, then:
|
|
1603
1528
|
if (includeCredentials) {
|
|
1604
1529
|
// 1. If the user agent is not configured to block cookies for httpRequest
|
|
1605
1530
|
// (see section 7 of [COOKIES]), then:
|
|
1606
1531
|
// TODO: credentials
|
|
1607
|
-
|
|
1608
1532
|
// 2. If httpRequest’s header list does not contain `Authorization`, then:
|
|
1609
|
-
|
|
1610
|
-
// 1. Let authorizationValue be null.
|
|
1611
|
-
let authorizationValue = null
|
|
1612
|
-
|
|
1613
|
-
// 2. If there’s an authentication entry for httpRequest and either
|
|
1614
|
-
// httpRequest’s use-URL-credentials flag is unset or httpRequest’s
|
|
1615
|
-
// current URL does not include credentials, then set
|
|
1616
|
-
// authorizationValue to authentication entry.
|
|
1617
|
-
if (hasAuthenticationEntry(httpRequest) && (
|
|
1618
|
-
httpRequest.useURLCredentials === undefined || !includesCredentials(requestCurrentURL(httpRequest))
|
|
1619
|
-
)) {
|
|
1620
|
-
// TODO
|
|
1621
|
-
} else if (includesCredentials(requestCurrentURL(httpRequest)) && isAuthenticationFetch) {
|
|
1622
|
-
// 3. Otherwise, if httpRequest’s current URL does include credentials
|
|
1623
|
-
// and isAuthenticationFetch is true, set authorizationValue to
|
|
1624
|
-
// httpRequest’s current URL, converted to an `Authorization` value
|
|
1625
|
-
const { username, password } = requestCurrentURL(httpRequest)
|
|
1626
|
-
authorizationValue = `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`
|
|
1627
|
-
}
|
|
1628
|
-
|
|
1629
|
-
// 4. If authorizationValue is non-null, then append (`Authorization`,
|
|
1630
|
-
// authorizationValue) to httpRequest’s header list.
|
|
1631
|
-
if (authorizationValue !== null) {
|
|
1632
|
-
httpRequest.headersList.append('Authorization', authorizationValue, false)
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1533
|
+
// TODO: credentials
|
|
1635
1534
|
}
|
|
1636
1535
|
|
|
1637
1536
|
// 21. If there’s a proxy-authentication entry, use it as appropriate.
|
|
@@ -1713,66 +1612,10 @@ async function httpNetworkOrCacheFetch (
|
|
|
1713
1612
|
// 13. Set response’s request-includes-credentials to includeCredentials.
|
|
1714
1613
|
response.requestIncludesCredentials = includeCredentials
|
|
1715
1614
|
|
|
1716
|
-
// 14. If response’s status is 401, httpRequest’s response tainting is not
|
|
1717
|
-
//
|
|
1718
|
-
//
|
|
1719
|
-
//
|
|
1720
|
-
// In Node.js there is no traversable navigable to prompt the user, but we
|
|
1721
|
-
// still need to handle URL-embedded credentials so authentication retries
|
|
1722
|
-
// for WebSocket handshakes continue to work.
|
|
1723
|
-
if (response.status === 401 && httpRequest.responseTainting !== 'cors' && includeCredentials && (
|
|
1724
|
-
request.useURLCredentials !== undefined ||
|
|
1725
|
-
isTraversableNavigable(request.traversableForUserPrompts)
|
|
1726
|
-
)) {
|
|
1727
|
-
// 2. If request’s body is non-null, then:
|
|
1728
|
-
if (request.body != null) {
|
|
1729
|
-
// 1. If request’s body’s source is null, then return a network error.
|
|
1730
|
-
if (request.body.source == null) {
|
|
1731
|
-
// Note: In Node.js, this code path should not be reached because
|
|
1732
|
-
// isTraversableNavigable() returns false for non-navigable contexts.
|
|
1733
|
-
// However, we handle it gracefully by returning the response instead of
|
|
1734
|
-
// a network error, as we won't actually retry the request.
|
|
1735
|
-
// This aligns with the Fetch spec discussion in whatwg/fetch#1132,
|
|
1736
|
-
// which allows implementations flexibility when credentials can't be obtained.
|
|
1737
|
-
return response
|
|
1738
|
-
}
|
|
1739
|
-
|
|
1740
|
-
// 2. Set request’s body to the body of the result of safely extracting
|
|
1741
|
-
// request’s body’s source.
|
|
1742
|
-
request.body = safelyExtractBody(request.body.source)[0]
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
// 3. If request’s use-URL-credentials flag is unset or isAuthenticationFetch is
|
|
1746
|
-
// true, then:
|
|
1747
|
-
if (request.useURLCredentials === undefined || isAuthenticationFetch) {
|
|
1748
|
-
// 1. If fetchParams is canceled, then return the appropriate network error
|
|
1749
|
-
// for fetchParams.
|
|
1750
|
-
if (isCancelled(fetchParams)) {
|
|
1751
|
-
return makeAppropriateNetworkError(fetchParams)
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
// 2. Let username and password be the result of prompting the end user for a
|
|
1755
|
-
// username and password, respectively, in request’s traversable for user prompts.
|
|
1756
|
-
// TODO
|
|
1757
|
-
|
|
1758
|
-
// 3. Set the username given request’s current URL and username.
|
|
1759
|
-
// requestCurrentURL(request).username = TODO
|
|
1760
|
-
|
|
1761
|
-
// 4. Set the password given request’s current URL and password.
|
|
1762
|
-
// requestCurrentURL(request).password = TODO
|
|
1763
|
-
|
|
1764
|
-
// In browsers, the user will be prompted to enter a username/password before the request
|
|
1765
|
-
// is re-sent. To prevent an infinite 401 loop, return the response for now.
|
|
1766
|
-
// https://github.com/nodejs/undici/pull/4756
|
|
1767
|
-
return response
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
|
-
// 4. Set response to the result of running HTTP-network-or-cache fetch given
|
|
1771
|
-
// fetchParams and true.
|
|
1772
|
-
fetchParams.controller.connection.destroy()
|
|
1773
|
-
|
|
1774
|
-
response = await httpNetworkOrCacheFetch(fetchParams, true)
|
|
1775
|
-
}
|
|
1615
|
+
// 14. If response’s status is 401, httpRequest’s response tainting is not
|
|
1616
|
+
// "cors", includeCredentials is true, and request’s window is an environment
|
|
1617
|
+
// settings object, then:
|
|
1618
|
+
// TODO
|
|
1776
1619
|
|
|
1777
1620
|
// 15. If response’s status is 407, then:
|
|
1778
1621
|
if (response.status === 407) {
|
|
@@ -1849,10 +1692,12 @@ async function httpNetworkFetch (
|
|
|
1849
1692
|
fetchParams.controller.connection = {
|
|
1850
1693
|
abort: null,
|
|
1851
1694
|
destroyed: false,
|
|
1852
|
-
destroy (err) {
|
|
1695
|
+
destroy (err, abort = true) {
|
|
1853
1696
|
if (!this.destroyed) {
|
|
1854
1697
|
this.destroyed = true
|
|
1855
|
-
|
|
1698
|
+
if (abort) {
|
|
1699
|
+
this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
|
|
1700
|
+
}
|
|
1856
1701
|
}
|
|
1857
1702
|
}
|
|
1858
1703
|
}
|
|
@@ -2043,8 +1888,8 @@ async function httpNetworkFetch (
|
|
|
2043
1888
|
|
|
2044
1889
|
// 11. Let pullAlgorithm be an action that resumes the ongoing fetch
|
|
2045
1890
|
// if it is suspended.
|
|
2046
|
-
const pullAlgorithm = () => {
|
|
2047
|
-
|
|
1891
|
+
const pullAlgorithm = async () => {
|
|
1892
|
+
await fetchParams.controller.resume()
|
|
2048
1893
|
}
|
|
2049
1894
|
|
|
2050
1895
|
// 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
|
|
@@ -2070,11 +1915,15 @@ async function httpNetworkFetch (
|
|
|
2070
1915
|
// cancelAlgorithm set to cancelAlgorithm.
|
|
2071
1916
|
const stream = new ReadableStream(
|
|
2072
1917
|
{
|
|
2073
|
-
start (controller) {
|
|
1918
|
+
async start (controller) {
|
|
2074
1919
|
fetchParams.controller.controller = controller
|
|
2075
1920
|
},
|
|
2076
|
-
pull
|
|
2077
|
-
|
|
1921
|
+
async pull (controller) {
|
|
1922
|
+
await pullAlgorithm(controller)
|
|
1923
|
+
},
|
|
1924
|
+
async cancel (reason) {
|
|
1925
|
+
await cancelAlgorithm(reason)
|
|
1926
|
+
},
|
|
2078
1927
|
type: 'bytes'
|
|
2079
1928
|
}
|
|
2080
1929
|
)
|
|
@@ -2101,10 +1950,8 @@ async function httpNetworkFetch (
|
|
|
2101
1950
|
// 19. Run these steps in parallel:
|
|
2102
1951
|
|
|
2103
1952
|
// 1. Run these steps, but abort when fetchParams is canceled:
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
}
|
|
2107
|
-
|
|
1953
|
+
fetchParams.controller.onAborted = onAborted
|
|
1954
|
+
fetchParams.controller.on('terminated', onAborted)
|
|
2108
1955
|
fetchParams.controller.resume = async () => {
|
|
2109
1956
|
// 1. While true
|
|
2110
1957
|
while (true) {
|
|
@@ -2212,236 +2059,208 @@ async function httpNetworkFetch (
|
|
|
2212
2059
|
|
|
2213
2060
|
function dispatch ({ body }) {
|
|
2214
2061
|
const url = requestCurrentURL(request)
|
|
2215
|
-
/** @type {import('
|
|
2062
|
+
/** @type {import('../..').Agent} */
|
|
2216
2063
|
const agent = fetchParams.controller.dispatcher
|
|
2217
2064
|
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2065
|
+
return new Promise((resolve, reject) => agent.dispatch(
|
|
2066
|
+
{
|
|
2067
|
+
path: url.pathname + url.search,
|
|
2068
|
+
origin: url.origin,
|
|
2069
|
+
method: request.method,
|
|
2070
|
+
body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
|
|
2071
|
+
headers: request.headersList.entries,
|
|
2072
|
+
maxRedirections: 0,
|
|
2073
|
+
upgrade: request.mode === 'websocket' ? 'websocket' : undefined
|
|
2074
|
+
},
|
|
2075
|
+
{
|
|
2076
|
+
body: null,
|
|
2077
|
+
abort: null,
|
|
2078
|
+
|
|
2079
|
+
onConnect (abort) {
|
|
2080
|
+
// TODO (fix): Do we need connection here?
|
|
2081
|
+
const { connection } = fetchParams.controller
|
|
2082
|
+
|
|
2083
|
+
// Set timingInfo’s final connection timing info to the result of calling clamp and coarsen
|
|
2084
|
+
// connection timing info with connection’s timing info, timingInfo’s post-redirect start
|
|
2085
|
+
// time, and fetchParams’s cross-origin isolated capability.
|
|
2086
|
+
// TODO: implement connection timing
|
|
2087
|
+
timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)
|
|
2088
|
+
|
|
2089
|
+
if (connection.destroyed) {
|
|
2090
|
+
abort(new DOMException('The operation was aborted.', 'AbortError'))
|
|
2091
|
+
} else {
|
|
2092
|
+
fetchParams.controller.on('terminated', abort)
|
|
2093
|
+
this.abort = connection.abort = abort
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
// Set timingInfo’s final network-request start time to the coarsened shared current time given
|
|
2097
|
+
// fetchParams’s cross-origin isolated capability.
|
|
2098
|
+
timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
|
|
2236
2099
|
},
|
|
2237
|
-
{
|
|
2238
|
-
body: null,
|
|
2239
|
-
abort: null,
|
|
2240
|
-
|
|
2241
|
-
onRequestStart (controller) {
|
|
2242
|
-
// TODO (fix): Do we need connection here?
|
|
2243
|
-
const { connection } = fetchParams.controller
|
|
2244
|
-
|
|
2245
|
-
// Set timingInfo’s final connection timing info to the result of calling clamp and coarsen
|
|
2246
|
-
// connection timing info with connection’s timing info, timingInfo’s post-redirect start
|
|
2247
|
-
// time, and fetchParams’s cross-origin isolated capability.
|
|
2248
|
-
// TODO: implement connection timing
|
|
2249
|
-
timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)
|
|
2250
|
-
|
|
2251
|
-
const abort = (reason) => controller.abort(reason)
|
|
2252
|
-
|
|
2253
|
-
if (connection.destroyed) {
|
|
2254
|
-
abort(new DOMException('The operation was aborted.', 'AbortError'))
|
|
2255
|
-
} else {
|
|
2256
|
-
fetchParams.controller.on('terminated', abort)
|
|
2257
|
-
this.abort = connection.abort = abort
|
|
2258
|
-
}
|
|
2259
2100
|
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
// time given fetchParams’s cross-origin isolated capability, immediately after the
|
|
2268
|
-
// user agent’s HTTP parser receives the first byte of the response (e.g., frame header
|
|
2269
|
-
// bytes for HTTP/2 or response status line for HTTP/1.x).
|
|
2270
|
-
timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
|
|
2271
|
-
},
|
|
2272
|
-
|
|
2273
|
-
onResponseStart (controller, status, headers, statusText) {
|
|
2274
|
-
if (status < 200) {
|
|
2275
|
-
return
|
|
2276
|
-
}
|
|
2101
|
+
onResponseStarted () {
|
|
2102
|
+
// Set timingInfo’s final network-response start time to the coarsened shared current
|
|
2103
|
+
// time given fetchParams’s cross-origin isolated capability, immediately after the
|
|
2104
|
+
// user agent’s HTTP parser receives the first byte of the response (e.g., frame header
|
|
2105
|
+
// bytes for HTTP/2 or response status line for HTTP/1.x).
|
|
2106
|
+
timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
|
|
2107
|
+
},
|
|
2277
2108
|
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2109
|
+
onHeaders (status, rawHeaders, resume, statusText) {
|
|
2110
|
+
if (status < 200) {
|
|
2111
|
+
return
|
|
2112
|
+
}
|
|
2282
2113
|
|
|
2283
|
-
|
|
2114
|
+
let location = ''
|
|
2284
2115
|
|
|
2285
|
-
|
|
2286
|
-
redirectStatusSet.has(status)
|
|
2116
|
+
const headersList = new HeadersList()
|
|
2287
2117
|
|
|
2288
|
-
|
|
2118
|
+
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
2119
|
+
headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)
|
|
2120
|
+
}
|
|
2121
|
+
location = headersList.get('location', true)
|
|
2289
2122
|
|
|
2290
|
-
|
|
2291
|
-
if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
|
|
2292
|
-
// https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
|
|
2293
|
-
const contentEncoding = headersList.get('content-encoding', true)
|
|
2294
|
-
// "All content-coding values are case-insensitive..."
|
|
2295
|
-
/** @type {string[]} */
|
|
2296
|
-
const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []
|
|
2123
|
+
this.body = new Readable({ read: resume })
|
|
2297
2124
|
|
|
2298
|
-
|
|
2299
|
-
// CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
|
|
2300
|
-
const maxContentEncodings = 5
|
|
2301
|
-
if (codings.length > maxContentEncodings) {
|
|
2302
|
-
reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
|
|
2303
|
-
return
|
|
2304
|
-
}
|
|
2125
|
+
const decoders = []
|
|
2305
2126
|
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
} else if (coding === 'br') {
|
|
2324
|
-
decoders.push(zlib.createBrotliDecompress({
|
|
2325
|
-
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
2326
|
-
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
|
|
2327
|
-
}))
|
|
2328
|
-
} else if (coding === 'zstd') {
|
|
2329
|
-
decoders.push(zlib.createZstdDecompress({
|
|
2330
|
-
flush: zlib.constants.ZSTD_e_continue,
|
|
2331
|
-
finishFlush: zlib.constants.ZSTD_e_end
|
|
2332
|
-
}))
|
|
2333
|
-
} else {
|
|
2334
|
-
decoders.length = 0
|
|
2335
|
-
break
|
|
2336
|
-
}
|
|
2337
|
-
}
|
|
2127
|
+
const willFollow = location && request.redirect === 'follow' &&
|
|
2128
|
+
redirectStatusSet.has(status)
|
|
2129
|
+
|
|
2130
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
|
2131
|
+
if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
|
|
2132
|
+
// https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
|
|
2133
|
+
const contentEncoding = headersList.get('content-encoding', true)
|
|
2134
|
+
// "All content-coding values are case-insensitive..."
|
|
2135
|
+
/** @type {string[]} */
|
|
2136
|
+
const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []
|
|
2137
|
+
|
|
2138
|
+
// Limit the number of content-encodings to prevent resource exhaustion.
|
|
2139
|
+
// CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
|
|
2140
|
+
const maxContentEncodings = 5
|
|
2141
|
+
if (codings.length > maxContentEncodings) {
|
|
2142
|
+
reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
|
|
2143
|
+
return true
|
|
2338
2144
|
}
|
|
2339
2145
|
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
})
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2146
|
+
for (let i = codings.length - 1; i >= 0; --i) {
|
|
2147
|
+
const coding = codings[i].trim()
|
|
2148
|
+
// https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
|
|
2149
|
+
if (coding === 'x-gzip' || coding === 'gzip') {
|
|
2150
|
+
decoders.push(zlib.createGunzip({
|
|
2151
|
+
// Be less strict when decoding compressed responses, since sometimes
|
|
2152
|
+
// servers send slightly invalid responses that are still accepted
|
|
2153
|
+
// by common browsers.
|
|
2154
|
+
// Always using Z_SYNC_FLUSH is what cURL does.
|
|
2155
|
+
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
2156
|
+
finishFlush: zlib.constants.Z_SYNC_FLUSH
|
|
2157
|
+
}))
|
|
2158
|
+
} else if (coding === 'deflate') {
|
|
2159
|
+
decoders.push(createInflate({
|
|
2160
|
+
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
2161
|
+
finishFlush: zlib.constants.Z_SYNC_FLUSH
|
|
2162
|
+
}))
|
|
2163
|
+
} else if (coding === 'br') {
|
|
2164
|
+
decoders.push(zlib.createBrotliDecompress({
|
|
2165
|
+
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
2166
|
+
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
|
|
2167
|
+
}))
|
|
2168
|
+
} else {
|
|
2169
|
+
decoders.length = 0
|
|
2170
|
+
break
|
|
2171
|
+
}
|
|
2359
2172
|
}
|
|
2173
|
+
}
|
|
2360
2174
|
|
|
2361
|
-
|
|
2362
|
-
// message body, then:
|
|
2175
|
+
const onError = this.onError.bind(this)
|
|
2363
2176
|
|
|
2364
|
-
|
|
2365
|
-
|
|
2177
|
+
resolve({
|
|
2178
|
+
status,
|
|
2179
|
+
statusText,
|
|
2180
|
+
headersList,
|
|
2181
|
+
body: decoders.length
|
|
2182
|
+
? pipeline(this.body, ...decoders, (err) => {
|
|
2183
|
+
if (err) {
|
|
2184
|
+
this.onError(err)
|
|
2185
|
+
}
|
|
2186
|
+
}).on('error', onError)
|
|
2187
|
+
: this.body.on('error', onError)
|
|
2188
|
+
})
|
|
2366
2189
|
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
// See pullAlgorithm.
|
|
2190
|
+
return true
|
|
2191
|
+
},
|
|
2370
2192
|
|
|
2371
|
-
|
|
2372
|
-
|
|
2193
|
+
onData (chunk) {
|
|
2194
|
+
if (fetchParams.controller.dump) {
|
|
2195
|
+
return
|
|
2196
|
+
}
|
|
2373
2197
|
|
|
2374
|
-
|
|
2198
|
+
// 1. If one or more bytes have been transmitted from response’s
|
|
2199
|
+
// message body, then:
|
|
2375
2200
|
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
}
|
|
2379
|
-
},
|
|
2201
|
+
// 1. Let bytes be the transmitted bytes.
|
|
2202
|
+
const bytes = chunk
|
|
2380
2203
|
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
}
|
|
2204
|
+
// 2. Let codings be the result of extracting header list values
|
|
2205
|
+
// given `Content-Encoding` and response’s header list.
|
|
2206
|
+
// See pullAlgorithm.
|
|
2385
2207
|
|
|
2386
|
-
|
|
2208
|
+
// 3. Increase timingInfo’s encoded body size by bytes’s length.
|
|
2209
|
+
timingInfo.encodedBodySize += bytes.byteLength
|
|
2387
2210
|
|
|
2388
|
-
|
|
2389
|
-
},
|
|
2211
|
+
// 4. See pullAlgorithm...
|
|
2390
2212
|
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
fetchParams.controller.off('terminated', this.abort)
|
|
2394
|
-
}
|
|
2213
|
+
return this.body.push(bytes)
|
|
2214
|
+
},
|
|
2395
2215
|
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
error?.message === 'HTTP/2: Extended CONNECT protocol not supported by server'
|
|
2401
|
-
) {
|
|
2402
|
-
// The origin negotiated H2, but RFC 8441 websocket support is unavailable.
|
|
2403
|
-
// Retry the opening handshake on a fresh HTTP/1.1-only connection instead.
|
|
2404
|
-
resolve(dispatchWithProtocolPreference(body, false))
|
|
2405
|
-
return
|
|
2406
|
-
}
|
|
2216
|
+
onComplete () {
|
|
2217
|
+
if (this.abort) {
|
|
2218
|
+
fetchParams.controller.off('terminated', this.abort)
|
|
2219
|
+
}
|
|
2407
2220
|
|
|
2408
|
-
|
|
2221
|
+
if (fetchParams.controller.onAborted) {
|
|
2222
|
+
fetchParams.controller.off('terminated', fetchParams.controller.onAborted)
|
|
2223
|
+
}
|
|
2409
2224
|
|
|
2410
|
-
|
|
2411
|
-
fetchParams.controller.terminate(error)
|
|
2412
|
-
}
|
|
2225
|
+
fetchParams.controller.ended = true
|
|
2413
2226
|
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
onRequestUpgrade (controller, status, headers, socket) {
|
|
2418
|
-
// We need to support 200 for websocket over h2 as per RFC-8441
|
|
2419
|
-
// Absence of session means H1
|
|
2420
|
-
if ((socket.session != null && status !== 200) || (socket.session == null && status !== 101)) {
|
|
2421
|
-
if (socket.session != null) {
|
|
2422
|
-
// The server refused the extended CONNECT, and nothing further
|
|
2423
|
-
// will settle this request. Fail the opening handshake here.
|
|
2424
|
-
controller.abort(new SocketError('bad upgrade', null))
|
|
2425
|
-
}
|
|
2426
|
-
return false
|
|
2427
|
-
}
|
|
2227
|
+
this.body.push(null)
|
|
2228
|
+
},
|
|
2428
2229
|
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2230
|
+
onError (error) {
|
|
2231
|
+
if (this.abort) {
|
|
2232
|
+
fetchParams.controller.off('terminated', this.abort)
|
|
2233
|
+
}
|
|
2432
2234
|
|
|
2433
|
-
|
|
2434
|
-
status,
|
|
2435
|
-
statusText: STATUS_CODES[status],
|
|
2436
|
-
headersList,
|
|
2437
|
-
socket
|
|
2438
|
-
})
|
|
2235
|
+
this.body?.destroy(error)
|
|
2439
2236
|
|
|
2440
|
-
|
|
2237
|
+
fetchParams.controller.terminate(error)
|
|
2238
|
+
|
|
2239
|
+
reject(error)
|
|
2240
|
+
},
|
|
2241
|
+
|
|
2242
|
+
onUpgrade (status, rawHeaders, socket) {
|
|
2243
|
+
if (status !== 101) {
|
|
2244
|
+
return
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
const headersList = new HeadersList()
|
|
2248
|
+
|
|
2249
|
+
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
2250
|
+
headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)
|
|
2441
2251
|
}
|
|
2252
|
+
|
|
2253
|
+
resolve({
|
|
2254
|
+
status,
|
|
2255
|
+
statusText: STATUS_CODES[status],
|
|
2256
|
+
headersList,
|
|
2257
|
+
socket
|
|
2258
|
+
})
|
|
2259
|
+
|
|
2260
|
+
return true
|
|
2442
2261
|
}
|
|
2443
|
-
|
|
2444
|
-
|
|
2262
|
+
}
|
|
2263
|
+
))
|
|
2445
2264
|
}
|
|
2446
2265
|
}
|
|
2447
2266
|
|