fix(http): host var scope across multi-request URLs#7064
fix(http): host var scope across multi-request URLs#7064dwisiswant0 wants to merge 2 commits intodevfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughFixes multi-request HTTP host/parameter leakage: query params are merged only when the evaluated request host equals the input host, and DSL mapping now uses the actual formed request URLs. Adds an integration test to validate host-variable isolation across requests. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pkg/protocols/http/build_request.go`:
- Around line 255-259: The host comparison using reqURL.Host == parsed.Host can
mismatch equivalent hosts (e.g., example.com vs example.com:80); update the
check to normalize hostnames and ports before merging params: extract hostname
via Hostname() and port via Port() from both reqURL and parsed, treat empty
ports as the scheme default (http->80, https->443), and compare
hostname+effectivePort equality; only when they match call
parsed.Params.Merge(reqURL.Params.Encode()) and assign to reqURL.Params
(referencing reqURL, parsed, parsed.Host, reqURL.Host, finalparams,
Params.Merge, Encode).
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
integration_tests/protocols/http/multi-request-host-variable-scope.yamlis excluded by!**/*.yaml
📒 Files selected for processing (3)
cmd/integration-test/http.gopkg/protocols/http/build_request.gopkg/protocols/http/request.go
Signed-off-by: Dwi Siswanto <git@dw1.io>
In multi-request HTTP templates, request-scoped host variables could inherit state from the original input target, and absolute URL requests could inherit queryparams from input URL. Fixes #7062 Signed-off-by: Dwi Siswanto <git@dw1.io>
85663c9 to
1bfc804
Compare
Neo - PR Security ReviewNo security issues found Highlights
Hardening Notes
Comment |
|
do not merge. |
|
The reporter confirmed this fixes the issue, all CI checks pass (including Windows), and the code changes look correct. Is there a reason this is on hold? |
Proposed changes
In multi-request HTTP templates, request-scoped
host variables could inherit state from the
original input target, and absolute URL requests
could inherit queryparams from input URL.
Fixes #7062
Proof
before:
after (this patch):
Checklist
Summary by CodeRabbit
Bug Fixes
Tests