My Http protocal, where I am setting disableFollowRedirects. However there is one get call I am making for which I want the execution to follow redirect. Can we do that ? I tried disableProtocolChecks but it isn't working
.baseUrl(brokerHost)
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") // Here are the common headers
.acceptEncodingHeader("gzip, deflate")
.acceptLanguageHeader("en-US,en;q=0.5")
.upgradeInsecureRequestsHeader("1")
.userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36")
.disableFollowRedirect
For this request I want to execution to follow redirects
.exec(http("Post SAML request to IDP")
.post(/authentication/SSOPOST/")
.check(status.is(302))
.check(header("Location").saveAs("redirecturl"))
)
No, it's not currently (as of gatling 3.4) possible, neither one way (disable globally and re-enable locally) or the other (enable globally and disable locally). There's no control over followRedirect behavior at the request level.
Now, could you please explain why you would be able to do that?
Usually, people want to disable followRedirect
because they think they should capture the Location
response header in the redirect response so they can capture data from the landing page url.
This is wrong. Instead, they should let followRedirect
enabled and use the currentLocation
and currentLocationRegex
checks.
Actually, we're considering removing the disableFollowRedirect
option, unless we really have a compelling reason not to do so.