-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove dummy auth & add trace header #10678
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
Conversation
🦋 Changeset detectedLatest commit: 2b6ac52 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
|
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
| headers.set("User-Agent", `wrangler/${wranglerVersion}`); | ||
| } | ||
|
|
||
| export function addTraceHeader(headers: Headers): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe update the name to indicate that it might not add anything?
i.e. addTraceHeaderWhenNeeded or maybeAddTraceHeader
| if (getTraceHeader()) { | ||
| headers.set("Cf-Trace-Id", getTraceHeader() as string); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: avoid the cast and calling the fn twice:
| if (getTraceHeader()) { | |
| headers.set("Cf-Trace-Id", getTraceHeader() as string); | |
| } | |
| const traceHeader = getTraceHeader(); | |
| if (traceHeader) { | |
| headers.set("Cf-Trace-Id", traceHeader); | |
| } |
| /** Docker host configuration (handled separately from environment variable factory). */ | ||
| | "DOCKER_HOST"; | ||
| | "DOCKER_HOST" | ||
| | "WRANGLER_TRACE_ID"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make it clearer that this is not in the // ## Docker Configuration section and add a comment.
Is this wrangler specific or should rather be CLOUDFLARE_...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would // ## Development & Local Testing be a better section to add that to?
vicb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor comments/suggestions
Remove dummy auth from KV (https://jira.cfdata.org/browse/DEVX-2170) and add support for injecting trace headers