Repository navigation
fix: follow 303 redirects with GET and append query data before fragments - #1000
Conversation
Mixed activityActivity patterns show a mix of organic and automated signals. Evidence
Last 1 PR: This is an automated analysis by AgentScan |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1000 +/- ##
==========================================
+ Coverage 94.91% 95.07% +0.16%
==========================================
Files 10 10
Lines 747 751 +4
Branches 235 235
==========================================
+ Hits 709 714 +5
+ Misses 35 34 -1
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the redirect and query-handling changes.
No open issues 🎉
What changed in this PR
This PR fixes two HTTP request behaviors in urllib reported in #981: handling 303 redirects and placing GET/HEAD query data before URL fragments.
Changes:
- Follow 303 redirects from non-GET/HEAD methods with a bodyless GET, removing content headers and body options.
- Keep redirect-target retries from replaying the original request.
- Append GET/HEAD data before fragments while preserving existing query parameters and caller-owned URL objects.
| File | Description |
|---|---|
| test/options.followRedirect.test.ts | Adds coverage for 303 method conversion, body removal, HEAD preservation, and redirected retries. |
| test/options.data.test.ts | Tests fragment-safe GET/HEAD queries and preservation of the original URL. |
| src/HttpClient.ts | Updates redirect handling, header filtering, retry propagation, and query construction. |
Review effort: Balanced
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
After a
POST, a303 See Otherresponse directs the client to retrieve the result. Repeating thePOSTcan submit the same data twice. The client now follows the redirect with aGETand drops the request body and its headers. If the destination closes the connection, the client retries the redirected request.For
GETandHEAD, the client previously appendeddataafter the URL fragment. The server never received those parameters. The client now appends them to the existing query before the fragment.Addresses the
303redirect and URL fragment reports in #981.Summary by CodeRabbit