]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.3] bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2292)
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 26 Jul 2017 02:43:52 +0000 (04:43 +0200)
committerNed Deily <nad@python.org>
Wed, 26 Jul 2017 02:43:52 +0000 (22:43 -0400)
commit052f9d6860c48c5abcff8e16212e77cf4249d66c
treede642ba7a941e21e085add9245a9e14c509dae40
parentb5f20ea91ec4d9dc7e1c31629903888c651bd02c
[3.3] bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2292)

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)
(cherry picked from commit cc54c1c0d2d05fe7404ba64c53df4b1352ed2262)
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]