Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
4 changes: 2 additions & 2 deletions Doc/library/urllib.parse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ or on combining URL components into a URL string.
decomposed before parsing, no error will be raised.

Following the `WHATWG spec`_ that updates RFC 3986, ASCII newline
``\n``, ``\r`` and tab ``\t`` characters are stripped from the url.
``\n``, ``\r`` and tab ``\t`` characters are stripped from the URL.

.. versionchanged:: 3.6
Out-of-range port numbers now raise :exc:`ValueError`, instead of
Expand All @@ -324,7 +324,7 @@ or on combining URL components into a URL string.
now raise :exc:`ValueError`.

.. versionchanged:: 3.10
ASCII newline and tab characters are stripped from the url.
ASCII newline and tab characters are stripped from the URL.

.. _WHATWG spec: https://url.spec.whatwg.org/#concept-basic-url-parser

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Presence newline or tab characters in URL allowed attackers to write scripts
in URL, hijack the the the web-server.
The presence of newline or tab characters in parts of a URL could allow
some forms of attacks.

Following the controlling specification for URLs defined by WHATWG
urllib.parse strips ASCII newline and tabs from the url, preventing such
attacks.
:func:`urllib.parse` now removes ASCII newlines and tabs from URLs,
preventing such attacks.