[Pulse demo] psf/requests PR #7194: Fix: Strip proxies when redirect URL matches no_proxy - #32
[Pulse demo] psf/requests PR #7194: Fix: Strip proxies when redirect URL matches no_proxy#32dominic097 wants to merge 1 commit into
Conversation
| else: | ||
| raise UnrewindableBodyError("Unable to rewind request body for redirect.") | ||
|
|
||
| # Pulse demo seed 2026-06-24: metadata from psf/requests PR #7194 |
There was a problem hiding this comment.
🐞 correctness · 🟠 Major
PR claims a no_proxy redirect fix, but no executable behavior changed
This diff does not implement the bug fix described in the PR. In src/requests/utils.py, the only live-code change is this trailing comment, while the actual fix described in .pulse-demo/sampled-prs/2026-06-24/upstream-pr-7194.json says resolve_proxies() should be modified to remove scheme-specific and all proxies when should_bypass_proxies() matches. Because no runtime logic changed in this repository, redirects to no_proxy destinations will continue using the old behavior and the reported issue remains unresolved. Please port the actual resolve_proxies() implementation change into this branch and add the corresponding tests.
P2 · Impact high (4/5) · Confidence high
🤖 Prompt for AI agents
Implement the real no_proxy redirect fix in `src/requests/utils.py` by updating `resolve_proxies()` so existing proxies are stripped when the target URL matches bypass rules, and add regression tests covering redirect transitions from proxied to bypassed destinations.
🔒 Secure confirmation — opens an authenticated page; the fix is attributed to you. Or reply @aziron fix finding:F1
| }, | ||
| { | ||
| "additions": 128, | ||
| "changeType": "MODIFIED", |
There was a problem hiding this comment.
🧪 test · 🟡 Moderate
Referenced regression tests were not added to the actual test suite
The metadata added here states that the upstream fix included modifications to tests/test_utils.py with 7 new TestResolveProxies cases, but this PR does not change any real test files in this repository. That leaves the intended redirect/no_proxy behavior unverified here and increases the chance that the eventual logic change regresses or is ported incorrectly. Please add the corresponding regression tests in the actual test suite alongside the implementation change, rather than only embedding their existence in this JSON snapshot.
P3 · Impact medium (3/5) · Confidence high
🤖 Prompt for AI agents
Add real regression tests in `tests/test_utils.py` for `resolve_proxies()` covering bypass on redirect targets that match `no_proxy`, including stripping scheme-specific and `all` proxies and preserving proxies when bypass does not apply.
🔒 Secure confirmation — opens an authenticated page; the fix is attributed to you. Or reply @aziron fix finding:F2
🔍 Aziron Pulse Review
This PR does not implement the described no_proxy redirect fix in the actual runtime code. It only adds a metadata snapshot file and a trailing comment in src/requests/utils.py, so the reported issue remains unresolved and no tests were added. Confidence Score: 2/5 The bounded diff is explicit: the only live-code change is a comment in 💬 Pre-merge checks · ✅ 2 · ❌ 2❌ Failed checks
✅ Passed checks
📝 WalkthroughEngineering ReviewWhat changed: Two files changed: Correctness: The change is not correct relative to the stated fix. The added JSON file says the intended behavior is to modify Completeness: The change is incomplete. The metadata file references modifications to Risks: Primary risk is a false sense of resolution: the PR title/body claim a production bug fix, but shipping this branch would leave redirect handling unchanged. There is also maintenance noise from adding Missing tests: Tests are missing for the actual behavior under discussion. At minimum, there should be coverage in Follow-up work: Port the real upstream implementation into Decision — REQUEST_CHANGES: Requesting changes because the root issue is not addressed in this branch: there is no functional implementation of the no_proxy redirect fix, no relevant tests, and the PR description materially overstates what ships. Under the stated criteria, a PR must not be approved when the intended bug remains unresolved or critical tests are absent. 📁 Files changedImportant Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Meta as .pulse-demo JSON
participant Utils as src/requests/utils.py
participant Runtime as Redirect/proxy flow
Dev->>Meta: Add upstream PR snapshot
Dev->>Utils: Add trailing comment only
Note over Runtime: No executable proxy resolution logic changed
Runtime-->>Runtime: resolve_proxies()/redirect behavior remains as before
Note over Meta,Runtime: Documented fix exists only in metadata, not in shipped code
Actionable comments posted: 2 (0 suggested change(s), 2 fix-session candidate(s)) Fix all findings: comment 📋 Reviewed against: lint (python): Aziron Pulse — sandbox + MCP-assisted LLM review with native code intelligence. |
|
🪄 Autofix — generate a fix for all Aziron Pulse findings on this PR:
Tick the box above (or comment |
tests/test_utils.py(MODIFIED)The root cause was in resolve_proxies() - when should_bypass_proxies() returned True, the function only avoided adding new environment proxies, but did not remove existing proxies that were passed in from the original request.
Changes:
This ensures that when following a redirect from a proxied URL to an internal URL that matches no_proxy, the proxy configuration is correctly stripped for the internal request.