Repository navigation
🧹 chore: copy the forwarder name before storing it in the refused-request test - #4819
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Copy header value in test capture middleware/proxy/proxy_test.go |
The test copies the value returned by c.Get before storing it in hits. |
Priority:
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Other
Suggested reviewers: gaby
Merge Risk: 
Minimal · up to 0c0e4
-
No merge-blocking risk remains from this change.
Pre-merge checks: 
5
-
Full details: Description check
-
Explanation
The description explains the failure, its cause, the fix, and the reported tests. It omits several template sections and checklists, but includes the main information needed for this focused test change.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the proxy test,
And copies headers for the best.
The value hops into its place,
Stored safely in the test’s embrace.
Then thumps its feet and takes a rest.
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4819 +/- ##
=======================================
Coverage 95.86% 95.86%
=======================================
Files 153 153
Lines 19312 19312
=======================================
Hits 18513 18513
- Misses 499 500 +1
+ Partials 300 299 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Test_Proxy_RefusedRequestIsNotForwardedfailed in a CI run on #4799: theDomainForwardsubtest got a 200 from the upstream, buthits.Load("DomainForward accepted")found nothing.The upstream handler stored
c.Get("X-Forwarder")as the map key. That string points into the request header buffer, andForward,DomainForwardandBalancerForwardshare one client, so a later subtest's request that reuses the idle upstream connection overwrites the stored key in place ("DomainForward accepted" reads back as "Forward acceptedcepted"). The key is now copied withutils.CopyString.Tests
DomainForwardrequest and then theForwardrequest one after the other misses the key every time with the old handler and finds it with the copy.go test -race -shuffle=on ./middleware/proxy/andgolangci-lintare clean.🤖 Maintainers:
/generatere-runs the code generators on this branch