Ah, thanks! I was already getting quite lost here, seriously doubting my 
own understanding of the situation :)

Looking forward to your next reply!

On Friday, January 29, 2021 at 4:27:20 PM UTC+1 José Valim wrote:

> 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/66ac514a-72b1-42db-99df-9a4823fdb892n%40googlegroups.com.

Reply via email to