Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/library/urllib.parse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,17 @@
sense? Is that a sensible ``path``? Is there anything strange about that
``hostname``? etc.

.. warning::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not make sense to have a warning note here. In addition, its placing interrupts the flow of the current text and is quite off-topic here.


:func:`urlsplit` (and :func:`urlparse`) does not consider a URL's

Check warning on line 535 in Doc/library/urllib.parse.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: urllib.parse.SplitResult.netloc [ref.attr]
:attr:`~urllib.parse.SplitResult.netloc` to be present unless
it is preceded by ``//``. This means that, for example, the URL
``///example.com/path`` will be parsed with an empty ``netloc`` and a
``path`` of ``/example.com/path``. This behavior may lead to open redirect
vulnerabilities in applications that rely on checking the ``netloc`` to
validate redirect URLs. Always carefully validate redirect targets,
preferably using an allowlist of known-safe URLs or hosts.

What constitutes a URL is not universally well defined. Different applications
have different needs and desired constraints. For instance the living `WHATWG
spec`_ describes what user facing web clients such as a web browser require.
Expand Down
Loading