Tal Einat <taleinat+pyt...@gmail.com> added the comment:

Putting aside backwards compatibility, I would argue the opposite: Since 
consecutive slashes are valid, I suggest we would need to see that collapsing 
them into a single slash is the status quo, otherwise we should avoid such 
collapsing.

Here's some evidence that we should keep consecutive slashes:

1.
The curl cli does not appear to collapse consecutive slashes in URLs before 
sending them:

$ nc -l localhost 8000 &
[1] 39380
$ curl --dump-header - --proxy localhost:8000 --silent --max-time 1 
http://www.example.com/this//double/path
GET http://www.example.com/this//double/path HTTP/1.1
Host: www.example.com
User-Agent: curl/7.64.1
Accept: */*
Proxy-Connection: Keep-Alive

[1]  + 39380 done       nc -l localhost 8000


2.
With NodeJS v10.18.0 and v12.16.1:

> const urllib = require('url');
> new url.URL("this//double/path", "http://www.example.com/";).href
'http://www.example.com/this//double/path'


For me this is evidence enough that urljoin should *not* be collapsing 
consecutive slashes.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40594>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to