Repository navigation
fix(workbuddy): sanitize Claude Code billing attribution headers - #482
Merged
Merged
Conversation
Strip x-anthropic-billing-header and x-anthropic-billing-hdr from the existing WorkBuddy WAF request-body sanitizer (hub #855 / v2.0.8) so these reserved keys are not sent upstream as-is (400 / 11128). A system message that is only that header is dropped, and a leading system prompt is restored if needed to avoid empty content (11151).
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.
Summary
x-anthropic-billing-headerandx-anthropic-billing-hdrto the existing WorkBuddy WAF request-body sanitizer (sanitizeFingerprintText/sanitizeWAFKeywordsinpayload.go)cch=params), with the embedded and bare-key fallbacks from hub #855 / v2.0.8ensureLeadingSystemrestores a non-empty leading system prompt if needed (avoids 400 / 11151)Aligns with workbuddy2api-hub #855 (landed in v2.0.8, tip 7ffba72). Claude Code 2.1.37+ injects these reserved keys into the first system text block; sending them as-is is rejected with 400 / 11128.
Out of scope
Test plan
go test ./internal/providers/workbuddy/ -count=1go vet ./internal/providers/workbuddy/python3 scripts/release-notes.py validate