fix: missing beforeRedirect requestDetails argument#6241
fix: missing beforeRedirect requestDetails argument#6241jasonsaayman merged 1 commit intoaxios:v1.xfrom
Conversation
8c4198d to
b8b4296
Compare
|
@DigitalBrainJS any chance we could get 👀 on this please? It’s a regression similar to #5778 with a simple fix, and I see @-ing you in that PR helped to get it over the line. |
|
@jasonsaayman any chance I could get 👀 on this PR please? It’s been hanging for a while but is a pretty simple fix for a behavior regression from earlier versions which is holding us back from upgrading. |
There was a problem hiding this comment.
Pull Request Overview
This PR restores the missing third requestDetails argument to the beforeRedirect callback function, fixing a regression from v0.27.2 to v1.67.0. The requestDetails parameter contains the original request's method, URL, and headers prior to the redirect.
Changes:
- Updated the
dispatchBeforeRedirectfunction signature to accept and pass through therequestDetailsparameter - Updated TypeScript definitions to reflect the third parameter
- Added test coverage to verify the
requestDetailsargument is properly passed
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/adapters/http.js | Updated dispatchBeforeRedirect function to accept and forward the requestDetails parameter to the user's beforeRedirect callback |
| index.d.ts | Added the requestDetails parameter type definition to the beforeRedirect callback signature |
| index.d.cts | Added the requestDetails parameter type definition to the beforeRedirect callback signature (CommonJS) |
| test/unit/adapters/http.js | Enhanced test to verify the requestDetails parameter is properly passed with the original URL |
|
@jasonsaayman I reapplied my changes onto the latest v1.x branch. Please could you take another look? |
When attempting to upgrade from
v0.27.2tov1.67.0we found that Axios is no longer passing through the thirdrequestDetailsargument to thebeforeRedirect(…)function.This contains the request’s original method, URL, and headers prior to the redirect.
This PR adds this argument back in.
Fixes #6442