Hi Ole,

On Wednesday, June 21, 2017 at 12:42:39 PM UTC+2, Ole Laursen wrote:
>
> I'm sorry if I gave the impression that I'm trying to nitpick 
> adherence to a standard.
>

You absolutely did not, I guess my mail was tenser than it was intended to 
be.
 

> What I'm addressing here is specifically the comment in the source and 
> the assumptions it is making, which I have found confusing in practice 
> because I bumped into the encoding issues.
>

There is certainly no problem with adjusting the comment to be more 
accurate.

>> It is used for the scheme "https:". encodeURIComponent(":") returns 
> "%3A". 
> > 
> > The usefulness of that function seems questionable to me. 
>
> Could you elaborate why? What other function would you use client-side 
> to make sure that you generate a valid query string given a set of 
> parameters?
>

Sorry I've mixed it up with with encodeURI. encodeURIComponent takes the 
"safe" route and escapes everything (at least as far as I understand it) 
because it does not know where the component (unless "component" itself has 
a sepcific meaning that I am not aware of) ends up -- this also makes the 
function somewhat ugly to use because you escape more than you need to. On 
the other hand, if you use encodeURI:

encodeURI('http://google.com?:a=:asd')
"http://google.com?:a=:asd";

it does not escape ':' since it knows that there is no need to escape it.

It looks like urllib is more eager when it comes to escaping, * is 
> also escaped by default. . isn't. So it would probably have been 
> better if the signing code had picked . as default separator. 
>

I think this is a result of internally going through quote which only 
allows safe characters which are safe in every context. Whether that is a 
good decision or not, I do not know. It would probably have been better to 
choose '.' as delimiter, but I am not sure that the effort to change that 
is worth it. In the end I fear that a stylistic change is just not worth it 
(that doesn't mean that the documentation shouldn't be accurate though).

Cheers,
Florian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a2c27242-d443-4493-80ab-7f702e9fc911%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to