The documentation states that the Ktor Client follows redirects by default: https://ktor.io/docs/http-redirect.html
But on receiving HTTP 307 status code from my API I get
Actually I think it's the method. 307 and 308 are used instead of 301 and 302 when we want to ask the client to replay the exact same request to a different URL, and here it's a POST request to a /v1/* endpoint that redirects to /v2/* (I mean, it's actually a very old unversionned endpoint. redirecting to the versioned one, but you get it). I'll try with
checkHttpMethod = false
. Both of these configuration values should be part of the documentation though
👍 1
ribesg
01/10/2024, 9:57 AM
Is the security concern with
checkHttpMethod
that the response could have been altered to redirect to a different URL? Maybe a way to allow redirects for "dangerous" methods only if the host matches would be nice.
Unless there is a security concern even when redirecting to the same host that I'm not aware of