Repository navigation
Conversation
opieter-aws
requested review from
mkmeral
and removed request for
opieter-aws
October 16, 2026 14:43
This branch has not been deployed
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.
Description
curl -Ltreats a protocol-relativeLocation: //host/pathas a path on the original server, so valid redirects reach the wrong destination. Resolve these references by preserving the current scheme and using the authority fromLocation, on both the initial request and subsequent redirect hops.Absolute URLs and ordinary relative paths retain their existing handling. URL allowlisting, DNS/IP checks, protocol restrictions, and credential injection are unchanged.
Related Issues
Fixes #132
Documentation PR
Not applicable: this restores the expected redirect behavior without changing the command's public interface.
Type of Change
Bug fix
Testing
cargo xtask check --rust-onlypassed on macOS arm64 with Rust 1.92: formatting, clippy, 1,808 Rust tests, and documentation generation with warnings denied. Clippy reports existing warnings in untouched files; none concern the changed files.The new redirect and target-allowlist regressions fail against the original implementation and pass with the fix. The local HTTP integration tests cover both first and later hops, target path/query preservation, injected credentials being stripped, blocked destinations, and
--proto-redirenforcement.Also exercised the built CLI against two local HTTP servers: direct and chained redirects returned the target's response when allowed and were denied when only the original server was allowed. No AWS or model calls were made.
Python, Node, and WASM binding suites and the cross-platform matrix were not run locally; their binding surfaces are unchanged.
cargo test --workspace --all-targets,pytest tests/python,npm test) — Rust core suite; other bindings not changedcargo fmtandcargo clippyChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.