Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query parameters are not case-insensitive #1682

Open
asemindevex opened this issue Feb 27, 2020 · 2 comments
Open

Query parameters are not case-insensitive #1682

asemindevex opened this issue Feb 27, 2020 · 2 comments

Comments

@asemindevex
Copy link

Ktor Version and Engine Used (client or server and name)
1.3.1, server, ktor-server-netty

Describe the bug
Query parameters claim to be case-insensitive, however they are not. Namely, trying to get a query value for a key which differs only in case from the actual one does not find value.

To Reproduce
Steps to reproduce the behavior:
Using the most basic route to extract a parameter:

fun Route.myRoute() = route("my") {
    get {
        val param = call.request.queryParameters.getOrFail("param")
        call.respondText(param)
    }
}

Calling queryParameters.caseInsensitiveName returns true which is hardcoded.

However, decoder.parameters() returns a regular map, which fails to resolve parameters case-insensitively.

Expected behavior
Query parameters are resolved in the case-insensitive manner.

@cy6erGn0m
Copy link
Contributor

There is no particular specification regulating case-sensitivity, need to look for first

@oleg-larshin
Copy link

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants