Gah, I am so sorry. I have been working on the wrong assumption that
URI.encode_query was escaping space to %20 but it is encoding it to +,
which was your point all along. Yes, escaping it to + is not in accordance
to RFC3986.

I will re-read your original e-mail and address it accordingly now. Once
again, apologies.


On Fri, Jan 29, 2021 at 4:13 PM José Valim <[email protected]> wrote:

> > If I read this correctly, than given what you write, the current
> `URI.encode_query/1` implementation _is_ in violation of RFC3986. Example:
>
> You can’t compare the result of URI.encode with URI.encode_query because
> they are meant to escape different parts of an URI and different parts use
> different rules. They are both in accordance to the RFC though.
>
> The assumption that all of a URL needs to be escaped with URI.encode is
> incorrect. if we encode a query parameter with URI.encode, that will be
> the wrong result.
>
> Plus, the Wikipedia article explicitly mentions that escaping space as +
> is a difference to RFC3986, which confirms my assumption that RFC3986 does
> not mention whitespace *in query params* should be encoded as +:
>
> > The encoding of SPACE as '+' and the selection of "as-is" characters
> distinguishes this encoding from RFC 3986
> <https://tools.ietf.org/html/rfc3986>.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J_CrWXBztHgTZb7X7sYSquFg%3DH_bpGhKA57g6VKAnAyg%40mail.gmail.com.

Reply via email to