[issue13244] WebSocket schemes in urlparse

Jyrki Pulliainen report at bugs.python.org
Sat Oct 22 23:03:53 CEST 2011


Jyrki Pulliainen <jyrki at dywypi.org> added the comment:

Actually, if I get it right, it means that following url is valid:

  ws://example.com/something#somewhere/

and the # should be considered as being a part of the path. The spec does not say a thing should the # in path component be encoded, so I think it's safe to assume it should can be unencoded. However, following url

  ws://example.com/something?query=foo#bar

Is not considered to be valid, as the # is in the query part and is not escaped. So the valid would be:

  ws://example.com/something?query=foo%23bar

I think the motivation behind this is to reduce possible conflicts with browsers that might take the #-part as a fragment when it should be part of the query parameters. However, the confusion is still possible with # in path part.

My take on this would be to omit fragments and just parse the url as is without fragments. Encoding could be left to user, even in the case # is in query part.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13244>
_______________________________________


More information about the Python-bugs-list mailing list