Add parser.path to html sanitiser, fixing tests
This commit is contained in:
parent
fd0c0bd277
commit
2e1066477e
1 changed files with 1 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ def sanitize_http_url(url: str) -> Optional[str]:
|
||||||
if not parsed.netloc:
|
if not parsed.netloc:
|
||||||
return None
|
return None
|
||||||
fragment_str = "#" + parsed.fragment if parsed.fragment else ""
|
fragment_str = "#" + parsed.fragment if parsed.fragment else ""
|
||||||
return f"{parsed.scheme}://{parsed.netloc}{fragment_str}"
|
return f"{parsed.scheme}://{parsed.netloc}{parsed.path}{fragment_str}"
|
||||||
|
|
||||||
|
|
||||||
class SafeHTMLParser(HTMLParser):
|
class SafeHTMLParser(HTMLParser):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue