Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix headers in wfp dev #6904

Open
wants to merge 3 commits into
base: wfp-dev
Choose a base branch
from
Open

Fix headers in wfp dev #6904

wants to merge 3 commits into from

Conversation

GregBrimble
Copy link
Member

What this PR solves / how to test

Fixes CUSTESC-45403.

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: no e2e coverage
  • Changeset (Changeset guidelines)
    • TODO (before merge)
    • Changeset included
    • Changeset not necessary because: not managed with changesets
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: not yet in main branch

@GregBrimble GregBrimble requested a review from a team as a code owner October 6, 2024 23:25
Copy link

changeset-bot bot commented Oct 6, 2024

⚠️ No Changeset found

Latest commit: bfd9dd6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@@ -23,7 +23,7 @@ const dispatchee: Middleware = async (request, env, _ctx, middlewareCtx) => {
const outboundProxyUrl = request.headers.get(HEADER_OUTBOUND_PROXY_URL);
const parameters = request.headers.get(HEADER_PARAMETERS);

request = new Request(url, { ...request, cf });
request = new Request(url, { ...request, cf, method: request.method, headers: request.headers });
Copy link
Member Author

Choose a reason for hiding this comment

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

not every prop of a request, it turns out, is enumerable. Being explicit ensure we do pass the headers along.

Copy link
Contributor

github-actions bot commented Oct 6, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11206851323/npm-package-wrangler-6904

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6904/npm-package-wrangler-6904

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11206851323/npm-package-wrangler-6904 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11206851323/npm-package-create-cloudflare-6904 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11206851323/npm-package-cloudflare-kv-asset-handler-6904
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11206851323/npm-package-miniflare-6904
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11206851323/npm-package-cloudflare-pages-shared-6904
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11206851323/npm-package-cloudflare-vitest-pool-workers-6904

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240405.1
workerd 1.20240405.0 1.20240405.0
workerd --version 1.20240405.0 2024-04-05

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@GregBrimble GregBrimble force-pushed the fix-headers-in-wfp-dev branch 3 times, most recently from dbf87ae to 79ee9d7 Compare October 7, 2024 00:30
@@ -98,7 +107,7 @@ describe("external-dispatch-namespace-app", () => {
`"p2"`
);
expect(await dispatcherResponse.text()).toMatchInlineSnapshot(
`"intercepted"`
`"{\"accept\":\"*/*\",\"accept-encoding\":\"br, gzip\",\"accept-language\":\"*\",\"host\":\"localhost:${outbound.port}\",\"sec-fetch-mode\":\"cors\",\"user-agent\":\"undici\",\"x-foo\":\"bar\"}"`
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if host here should be preserved or overwritten. Need to check what prod runtime behavior is.

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.

1 participant