Redirects limit seems to not work

Hello,
I’m quite new in k6, but have a serious problem and cannot find any solution for now:
I’m using such piece of code somewhere in
const params = new URLSearchParams()
params.append(‘ReturnUrl’, returnUrl)
params.append(‘Username’, request.username)
params.append(‘Password’, request.password)
params.append(‘button’, ‘login’)
params.append(REQUEST_VERIFICATION_TOKEN_PARAM, requestVerificationToken)
const loginResp = http.post(loginUri, params , { headers: { Cookie: this.getCookieHeader() }, redirects: 0 })

but unfortunately i’m continuesly redirected, firstly getting 302, then 200 and finally 400.
I’m writting tests in TS and using some sample project with webpack bundling.

seems to be resolved, issue was somehow appearing due to URLSearchParams, once i got rid of it everything is fine again

1 Like

Hi @Greg

Welcome to the community forum :wave:

Thanks for posting the solution, it will help other users :smile:

Have a nice say!

Cheers!