Skip to content

Fix/test docs and header manipulation arrays#38

Open
godronus wants to merge 6 commits intomainfrom
fix/test-docs
Open

Fix/test docs and header manipulation arrays#38
godronus wants to merge 6 commits intomainfrom
fix/test-docs

Conversation

@godronus
Copy link
Copy Markdown
Collaborator

No description provided.

cookie headers not handled as string[]
Added support for Multi Headers like cookie
Copilot AI review requested due to automatic review settings April 22, 2026 15:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the FastEdge test runner and fixtures to preserve multi-valued HTTP headers end-to-end—most importantly Set-Cookie per RFC 6265 §3—across runners, wire protocols (WebSocket/API), frontend rendering, schemas, and test assertions.

Changes:

  • Introduces a lossless header projection (string | string[]) for hook/full-flow results and HTTP-WASM responses (Node IncomingHttpHeaders-shaped), with supporting helpers (firstValue, flattenToMap).
  • Fixes fetch-ingestion paths to keep multiple Set-Cookie values as string[] and updates fixtures (Rust/JS/AS) to emit multiple cookies for regression coverage.
  • Updates tests, JSON schemas, and generated docs to reflect multi-value header semantics and improved type exports.

Reviewed changes

Copilot reviewed 48 out of 48 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test-applications/http-apps/rust/wasi/http-responder/src/lib.rs Adds a request-triggered branch that emits two Set-Cookie headers for end-to-end regression coverage.
test-applications/http-apps/rust/basic/http-responder/src/lib.rs Same as above for the non-WASI Rust HTTP responder variant.
test-applications/http-apps/js/src/http-responder.ts Emits multiple Set-Cookie values via Headers.append() when x-set-cookies is present.
test-applications/cdn-apps/rust/cdn-headers/src/lib.rs Adds two set-cookie headers and extends expected header assertions accordingly.
test-applications/cdn-apps/as/cdn-headers/package.json Adds build/copy steps for the new headers.wasm target in the AS CDN headers app.
test-applications/cdn-apps/as/cdn-headers/assembly/headers.ts New AS strict header-validation app; adds Set-Cookie multi-value coverage in onResponseHeaders.
server/websocket/types.ts Widens header types in WebSocket payloads to `string
server/websocket/StateManager.ts Updates StateManager emit method signatures to match widened header typing.
server/utils/fastedge-cli.ts Adds TS suppression for import.meta.url under tsc CJS type-checking; minor formatting tweaks.
server/test-framework/assertions.ts Adds case-insensitive header lookup and multi-value matching semantics for assertion helpers.
server/runner/types.ts Introduces HeaderRecord (`Record<string, string
server/runner/ProxyWasmRunner.ts Preserves multiple Set-Cookie values from fetch, flattens request headers for fetch safely, and fixes header-counting to include duplicates.
server/runner/PropertyResolver.ts Stores headers as HeaderRecord and uses firstValue() where property paths require a scalar string.
server/runner/IWasmRunner.ts Types HTTP-WASM HttpResponse.headers as Node IncomingHttpHeaders and documents multi-value semantics.
server/runner/IStateManager.ts Widens header types in runner→state-manager event interfaces.
server/runner/HttpWasmRunner.ts Extracts parseFetchHeaders() to preserve Set-Cookie via getSetCookie(); returns IncomingHttpHeaders.
server/runner/HostFunctions.ts Stores httpCallResponse.headers as tuples to preserve duplicates and converts record/tuples appropriately.
server/runner/HeaderManager.ts Adds firstValue() + flattenToMap(), widens normalization/tuple conversions, and makes tuples→record projection lossless (string[] for multi-values).
server/tests/unit/runner/HttpWasmRunner.test.ts New unit tests for parseFetchHeaders() and multi-value assertion semantics (Set-Cookie).
server/tests/unit/runner/HeaderManager.test.ts Updates tuples→record expectations to preserve multi-values as string[]; adds Set-Cookie-specific test.
server/tests/integration/http-apps/http-responder/http-responder.test.ts Adds integration coverage asserting Set-Cookie remains a string[] across all HTTP-app variants.
server/tests/integration/cdn-apps/headers/multi-value-headers.test.ts Adds integration checks for set-cookie and other duplicated headers being projected as string[].
schemas/http-response.schema.json Updates schema to reference an IncomingHttpHeaders definition (multi-value Set-Cookie).
schemas/hook-result.schema.json Widens headers schema to string or string[].
schemas/hook-call.schema.json Widens headers schema to string or string[].
schemas/full-flow-result.schema.json Widens headers schema to string or string[].
package.json Adds types conditions to exports for . and ./test to fix TS type resolution.
frontend/src/types/index.ts Widens header types in frontend DTOs to `string
frontend/src/stores/types.ts Widens HTTP-WASM response headers to allow `string
frontend/src/hooks/websocket-types.ts Mirrors backend WebSocket header typing changes.
frontend/src/components/proxy-wasm/HookStagesPanel/HookStagesPanel.tsx Handles multi-valued content-type by reading the first value.
frontend/src/components/common/ResponsePanel/ResponsePanel.tsx Renders multi-valued headers as one row per value for readability.
frontend/src/api/index.ts Updates API typing for full-flow and HTTP-WASM execute responses to support multi-valued headers.
frontend/src/App.tsx Flattens any multi-valued headers to comma-joined strings for the editable request-headers UI field.
esbuild/bundle-lib.js Writes a top-level dist/lib/index.d.ts shim to re-export runner entry types for root import typing.
docs/WEBSOCKET.md Documents widened wire header value types (`string
docs/TEST_FRAMEWORK.md Updates documented header/result types and assertion helper semantics for multi-value headers.
docs/TEST_CONFIG.md Formatting/spacing updates in generated documentation tables.
docs/RUNNER.md Updates docs to reflect IncomingHttpHeaders and multi-valued Set-Cookie handling.
docs/INDEX.md Updates exported API list formatting in generated docs.
docs/DEBUGGER.md Updates generated debugger docs (env var table changed).
docs/API.md Notes widened output header shape (`string
context/features/MULTI_VALUE_HEADERS.md Expands/refreshes design notes: three header layers, Set-Cookie correctness, and in-repo AS port details.
context/features/CROSS_PLATFORM.md Updates documented port probing range (5179–5228).
context/architecture/BACKEND_ARCHITECTURE.md Documents the three header type layers and how they flow through the backend.
context/VSCODE_BUNDLING.md Updates documented port probing range (5179–5228).
context/CONTEXT_INDEX.md Updates index to reflect the expanded port probing range and refreshed multi-value header doc summary.
context/CHANGELOG.md Adds a detailed changelog entry for Set-Cookie/multi-value header preservation and type export fixes.

Comment thread docs/DEBUGGER.md Outdated
Comment thread schemas/http-response.schema.json
Comment thread package.json
@godronus godronus changed the title Fix/test docs Fix/test docs and header manipulation arrays Apr 23, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 79 out of 80 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

 Removed "OPTIONS" from cdn debugger methods
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 79 out of 80 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

frontend/src/hooks/websocket-types.ts:101

  • HttpWasmRequestCompletedEvent.data.response.contentType is typed as string here, but the backend event type (server/websocket/types.ts) and IWasmRunner.HttpResponse allow string | null. To keep the frontend WebSocket types truly mirroring the backend (and avoid runtime surprises if a null content-type is ever emitted), widen this to string | null (or normalize to "" on the server before broadcasting and document that invariant).
    response: {
      status: number;
      statusText: string;
      headers: Record<string, string | string[] | undefined>;
      body: string;
      contentType: string;
      isBase64?: boolean;
    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants