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

Reserved characters in path is not encoded #1293

Closed
anti-social opened this issue Aug 21, 2019 · 2 comments · Fixed by #2268
Closed

Reserved characters in path is not encoded #1293

anti-social opened this issue Aug 21, 2019 · 2 comments · Fixed by #2268
Assignees
Labels

Comments

@anti-social
Copy link
Contributor

anti-social commented Aug 21, 2019

Ktor client version: 1.2.3

URLBuilder(host = "localhost").apply {
    path("?")
    parameters["?"] = "?"
}
    .buildString()
    .also(::println)

will produce:

http://localhost/??%3F=%3F

I would expect the following url:

http://localhost/%3F?%3F=%3F

URLBuilder uses encodeURLQueryComponent function to encode a path: https://github.com/ktorio/ktor/blob/1.2.3/ktor-http/common/src/io/ktor/http/URLBuilder.kt#L50
Possibly it should use encodeURLPath?

Not sure it is a bug, but a feature. Fixing it will break backward compatibility.

@stale
Copy link

stale bot commented Nov 19, 2019

This issue has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the stale label Nov 19, 2019
@e5l e5l self-assigned this Jan 15, 2020
@stale stale bot removed the stale label Jan 15, 2020
@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
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants