play.shaded.ahc.org.asynchttpclient.handler.MaxRedirectException: Maximum redirect reached: 5

Hi All,

I am using WSClient and trying to get the status for links.
{
wsClient.url(linktoCheckStatus).head.map(response => response.status)
}
For status 200 its ok and running fine but link where we are having redirection i am getting below error.
play.shaded.ahc.org.asynchttpclient.handler.MaxRedirectException: Maximum redirect reached: 5.

Can we modify or overwrite this limit or is there any method by which we can check the last status only.
(ignoring redirection status).

Before trying to change the limit, are you sure that’s the right solution? How many redirects are you expecting?

Usually, if there are more than one or maybe two, it’s because there is a loop in the redirect. The maximum limit is in place to ensure that it doesn’t continue following redirects forever.

Otherwise, you can find documentation for configuring the limit or disabling following redirects here:

https://www.playframework.com/documentation/2.7.x/ScalaWS