Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
oauth2 misleading message on error 405 (wrong method) getting token #550
When I get 405 Method Not Allowed error from oauth2 server, ktor gives me an error message: "unsupported content type /".
I play with ktor and keycloak. When I forgot to set the requestMethod in oauth2 settings, I got this misleading message. The content is empty. In this case ktor should report 405 and not try to decode the content.
Probably in case of any unexpected http status, it should be reported as an error. Second thing, decoding should not be attempted on empty content, give a better message instead.