Skip to content

Use percentEncode on path segments in Url.Builder #41

@edkv

Description

@edkv

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions