fix(agent): encode non-ascii gateway property headers#3041
Open
MarxWellB wants to merge 1 commit into
Open
Conversation
Contributor
|
Reviews (1): Last reviewed commit: "fix(agent): encode non-ascii gateway pro..." | Re-trigger Greptile |
770af36 to
1375a41
Compare
1375a41 to
82ec8b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Slack-created PostHog Code tasks can fail when the task title contains non-ASCII characters. The original task title is forwarded as an
x-posthog-property-task_titleHTTP header value, and some HTTP clients reject header values containing characters outside the safe ASCII range.The original title should remain unchanged for storage and UI display. The unsafe boundary is only when the title is serialized into gateway property headers.
Fixes PostHog/posthog#65950.
Changes
encodeURIComponent.Why encode instead of strip?
Stripping non-ASCII characters makes the header safe, but loses user context. Encoding keeps the value ASCII-safe while preserving the original information in a reversible representation.
Examples:
How did you test this?
pnpm --filter @posthog/agent test gateway.test.tspnpm --filter @posthog/agent typecheck— fails locally due unresolved internal workspace packages such as@posthog/shared,@posthog/git, and@posthog/enricher; no errors are reported ingateway.tsorgateway.test.ts.