mirror of
https://github.com/tenrok/axios.git
synced 2026-06-08 17:22:34 +03:00
fix: fixed missed dispatchBeforeRedirect argument (#5778)
Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
This commit is contained in:
@@ -381,8 +381,8 @@ describe('supports http with nodejs', function () {
|
||||
}).listen(4444, function () {
|
||||
axios.get('http://localhost:4444/', {
|
||||
maxRedirects: 3,
|
||||
beforeRedirect: function (options) {
|
||||
if (options.path === '/foo') {
|
||||
beforeRedirect: function (options, responseDetails) {
|
||||
if (options.path === '/foo' && responseDetails.headers.location === '/foo') {
|
||||
throw new Error(
|
||||
'Provided path is not allowed'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user