Skip to content

Pin managed fetch dispatcher#5

Merged
jesse-merhi merged 1 commit into
mainfrom
jesse/proxyline-undici-bypass-policy
May 18, 2026
Merged

Pin managed fetch dispatcher#5
jesse-merhi merged 1 commit into
mainfrom
jesse/proxyline-undici-bypass-policy

Conversation

@jesse-merhi
Copy link
Copy Markdown
Member

Summary

  • Pins managed globalThis.fetch calls to the active Proxyline dispatcher so later setGlobalDispatcher() calls cannot bypass managed proxy routing.
  • Preserves invalid primitive fetch init rejection behavior while overriding explicit dispatcher options in managed mode.
  • Updates README, docs, security notes, and changelog to distinguish global fetch coverage from imported Undici APIs.

Verification

  • git diff --check
  • fnm exec --using v22.21.0 pnpm check
  • $code-review clean: Codex review clean plus cold/manual pass with no remaining actionable findings.

Copilot AI review requested due to automatic review settings May 18, 2026 00:24
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

Pins the managed globalThis.fetch patch to Proxyline's own dispatcher by explicitly setting (rather than stripping) the dispatcher init field, so that a later setGlobalDispatcher() cannot bypass managed proxy routing. Also preserves Undici's primitive-init rejection behavior and updates docs/changelog to clarify global fetch coverage vs. imported Undici APIs.

Changes:

  • Replaced stripFetchDispatcher with withManagedFetchDispatcher, which validates primitive init values and pins Proxyline's active managed dispatcher into the init.
  • Added tests covering invalid primitive init rejection and proxy routing surviving a setGlobalDispatcher() replacement in managed mode.
  • Updated README, surfaces.md, security.md, and CHANGELOG to describe the pinned-dispatcher behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/runtime.ts Refactor fetch init handling to pin managed dispatcher and validate primitive init.
test/package.test.ts New test verifying primitive init values are rejected with a TypeError.
test/e2e.test.ts New e2e test confirming managed routing survives setGlobalDispatcher.
README.md Clarify global fetch vs. Undici global dispatcher coverage.
docs/surfaces.md Update managed fetch description to reflect pinned dispatcher.
docs/security.md Update out-of-scope and threat table entries for pinned dispatcher.
docs/README.md Mirror README clarification on fetch coverage.
CHANGELOG.md Add 0.3.3 entry for the fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jesse-merhi jesse-merhi merged commit 5d3dc51 into main May 18, 2026
18 checks passed
@jesse-merhi jesse-merhi deleted the jesse/proxyline-undici-bypass-policy branch May 18, 2026 02:04
@steipete
Copy link
Copy Markdown
Contributor

Thanks @jesse-merhi. This landed in 5d3dc51, with follow-up changelog credit in b7f22d5 because the PR branch could not be updated from this checkout.

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.

3 participants