Skip to content

[wrangler] Add User-Agent header to remote dev inspector WebSocket connections#12463

Merged
petebacondarwin merged 1 commit intomainfrom
fix/4529-remote-dev-user-agent
Feb 9, 2026
Merged

[wrangler] Add User-Agent header to remote dev inspector WebSocket connections#12463
petebacondarwin merged 1 commit intomainfrom
fix/4529-remote-dev-user-agent

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Feb 7, 2026

Fixes #4529.

When running wrangler dev --remote, the inspector WebSocket connection to /cdn-cgi/workers/preview/inspector now includes a User-Agent header (wrangler/<version>). This resolves issues where WAF rules blocking empty User-Agent headers prevented remote dev mode from working with custom domains.

Changes

  • Pass WRANGLER_VERSION binding to the InspectorProxyWorker (the binding was already defined in the Env interface but wasn't being passed)
  • Add User-Agent header to the WebSocket upgrade request in InspectorProxyWorker.ts

This follows the existing pattern used for tail logs WebSocket connections in RemoteRuntimeController.ts.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: This is a minimal change that follows existing patterns. The fix adds a header to an existing WebSocket request. Existing tests pass and manual verification would require a WAF rule setup.
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This is an internal implementation detail fix that doesn't change any user-facing API or behavior.

Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 7, 2026

🦋 Changeset detected

Latest commit: 5102a16

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 7, 2026

Claude finished @petebacondarwin's task —— View job


Changeset Review

Todo List

  • Read changeset guidelines
  • Read the changeset file
  • Check attached image
  • Validate changeset against criteria
  • Provide final review

Review Result

All changesets look good

The changeset .changeset/user-agent-remote-dev.md is well-written and follows all guidelines:

  • Version Type: patch is correct - this is a bug fix addressing WAF blocking issues
  • Changelog Quality: Clear, meaningful description with good context about when the issue occurs and what it fixes
  • Markdown Headers: No h1/h2/h3 headers used
  • Analytics: No analytics changes in this PR
  • Format: Follows the recommended format with a concise title and explanatory body paragraph

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 7, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12463

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12463

miniflare

npm i https://pkg.pr.new/miniflare@12463

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12463

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12463

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12463

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12463

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12463

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12463

wrangler

npm i https://pkg.pr.new/wrangler@12463

commit: 5102a16

@petebacondarwin petebacondarwin marked this pull request as ready for review February 7, 2026 15:27
@petebacondarwin petebacondarwin requested a review from a team as a code owner February 7, 2026 15:27
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

…nnections

When running `wrangler dev --remote`, the inspector WebSocket connection
now includes a `User-Agent` header (`wrangler/<version>`). This resolves
issues where WAF rules blocking empty User-Agent headers prevented remote
dev mode from working with custom domains.

Fixes #4529
@petebacondarwin petebacondarwin force-pushed the fix/4529-remote-dev-user-agent branch from be6cd3f to 5102a16 Compare February 8, 2026 14:11
@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Feb 9, 2026
@petebacondarwin petebacondarwin merged commit 3388c84 into main Feb 9, 2026
36 checks passed
@petebacondarwin petebacondarwin deleted the fix/4529-remote-dev-user-agent branch February 9, 2026 11:33
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🚀 Feature Request: Have wrangler remote dev use a user-agent

3 participants