undici icon indicating copy to clipboard operation
undici copied to clipboard

Redirect Handler throwOnMaxRedirect

Open ronag opened this issue 1 year ago • 4 comments

Would like to have an option where the redirect handler throws on max redirects instead of just forwarding the result.

ronag avatar Nov 14 '23 11:11 ronag

@metcoder95

ronag avatar Nov 14 '23 11:11 ronag

It should be a matter of calling this.abort(new Error('max redirects') if the flag is set to true, right here: https://github.com/nodejs/undici/blob/ba4ca327843de62a83c1f9c32acc303bd6b8545f/lib/handler/RedirectHandler.js#L90-L92

Do you have something else to cover in mind?

metcoder95 avatar Nov 14 '23 12:11 metcoder95

https://github.com/nodejs/undici/pull/2546

@metcoder95

VigneshMurugan avatar Dec 27 '23 17:12 VigneshMurugan

See #951 as commented in #2260 the redirect interceptor and handler seem to lack any meaningful direct unit tests

Lewiscowles1986 avatar Dec 27 '23 20:12 Lewiscowles1986

landed: https://github.com/nodejs/undici/commit/a7551ce4e2f9d0f8ee1b5a44d4c429aae6d85abb

can I turn this issue off ?

mertcanaltin avatar Jan 17 '24 11:01 mertcanaltin