Skip to content

Conversation

frenzymadness
Copy link
Member

Raise warning for unstable URL parsing

urllib.parse does not perform any input validation so
its output might be invalid as well. Because host_whitelist
functionality relies on hostnames parsed from URLs, the result of
urlsplit is newly compared with the result of simple regex
parser and If they differ, a warning is raised.

@frenzymadness
Copy link
Member Author

The first round of feedback is addressed in the fixup commit. The URLs that cause the warning to be raised are not allowed anymore.

@frenzymadness
Copy link
Member Author

The last two fixup commits contain:

  • improved condition with more trust for the new parser
  • fixed typing
  • improved test

@hroncok could you please eyeball it before I merge it and release it?

`urllib.parse` does not perform any input validation so
its output might be invalid as well. Because host_whitelist
functionality relies on hostnames parsed from URLs, the result of
`urlsplit` is newly compared with the result of simple regex
parser and If they differ, a warning is raised.
@frenzymadness frenzymadness merged commit 8b3c612 into main Oct 9, 2024
9 checks passed
@frenzymadness frenzymadness deleted the url_parsing branch October 9, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants