Message196515
Similarly, I expected this to return "rtmp://host/app?auth=token":
urljoin("rtmp://host/app", "?auth=token")
I'm not sure adding everybody's custom scheme to a hard-coded whitelist is the best way to do solve this.
Below I have identified some other schemes not in the "uses_relative" list. Is there any reason why one would use urljoin() with them, but want the base URL to be ignored (as is the current behaviour)? I looked at test_urlparse.py and there doesn't seem to be any test cases for these schemes.
>>> all = set().union(uses_relative, uses_netloc, uses_params, non_hierarchical, uses_query, uses_fragment)
>>> sorted(all.difference(uses_relative))
['git', 'git+ssh', 'hdl', 'mailto', 'news', 'nfs', 'rsync', 'sip', 'sips', 'snews', 'tel', 'telnet']
Even if the behaviour can't be changed, could the documentation for urljoin() say something like this:
Only the following [uses_relative] schemes are allowed in the base URL; any other schemes result in the relative URL being returned without being joined to the base. |
|
Date |
User |
Action |
Args |
2013-08-30 06:08:19 | martin.panter | set | recipients:
+ martin.panter, orsenthil, mher, madison.may |
2013-08-30 06:08:19 | martin.panter | set | messageid: <1377842899.55.0.747295284631.issue18828@psf.upfronthosting.co.za> |
2013-08-30 06:08:19 | martin.panter | link | issue18828 messages |
2013-08-30 06:08:19 | martin.panter | create | |
|