]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2291)
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 12 Jul 2017 12:51:46 +0000 (14:51 +0200)
committerlarryhastings <larry@hastings.org>
Wed, 12 Jul 2017 12:51:46 +0000 (14:51 +0200)
commitcc54c1c0d2d05fe7404ba64c53df4b1352ed2262
treedf73846d6ca927314bdb24125bb902dbcfc942eb
parent71572bbe82aa0836c036d44d41c8269ba6a321be
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2291)

The current regex based splitting produces a wrong result. For example::

  http://abc#@def

Web browsers parse that URL as ``http://abc/#@def``, that is, the host
is ``abc``, the path is ``/``, and the fragment is ``#@def``.
(cherry picked from commit 90e01e50ef8a9e6c91f30d965563c378a4ad26de)
Lib/test/test_urlparse.py
Lib/urllib/parse.py
Misc/ACKS
Misc/NEWS.d/next/Security/2017-07-11-22-02-51.bpo-30500.wXUrkQ.rst [new file with mode: 0644]