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

Use percentEncode on path segments in Url.Builder #41

Open
edkv opened this issue Dec 17, 2020 · 1 comment
Open

Use percentEncode on path segments in Url.Builder #41

edkv opened this issue Dec 17, 2020 · 1 comment
Labels
breaking would require a MAJOR release request

Comments

@edkv
Copy link

edkv commented Dec 17, 2020

Example:

> Url.Builder.absolute [ "foo", "/", "bar" ] []
"/foo///bar" : String

Should be /foo%2Fbar, right?

I've seen #21, didn't read the spec, but here's what the Wikipedia article says about this concrete case:

The reserved character /, for example, if used in the "path" component of a URI, has the special meaning of being a delimiter between path segments. If, according to a given URI scheme, / needs to be in a path segment, then the three characters %2F or %2f must be used in the segment instead of a raw /.

I've run across this while debugging an issue in our application with Mapbox search API returning errors on punctuation/special symbols (the URL looks like https://api.mapbox.com/geocoding/v5/mapbox.places/<query>.json).

@Augustin82
Copy link

The same occurs when there are = in a query parameter.
I had to use percentEncode and percentDecode manually to work around that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking would require a MAJOR release request
Projects
None yet
Development

No branches or pull requests

3 participants