From 506d7a436993854b413c52fed438fa21ef61a06e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 22 May 2024 15:05:14 +0530 Subject: [PATCH] remove frag filtering Not actually needed --- kitty/open_actions.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kitty/open_actions.py b/kitty/open_actions.py index 409058bfb..c9dfd18c2 100644 --- a/kitty/open_actions.py +++ b/kitty/open_actions.py @@ -165,15 +165,10 @@ def actions_for_url_from_list(url: str, actions: Iterable[OpenAction]) -> Iterat path = unquote(purl.path) up = purl.path netloc = unquote(purl.netloc) if purl.netloc else '' - frag = '' if purl.query: up += f'?{purl.query}' - if purl.fragment: - frag = unquote(purl.fragment) - if frag.startswith('-') or frag.startswith(' '): - # Dont allow fragments that start with - as that can lead to arg injection - log_error(f'Ignoring fragment that starts with illegal character {frag[0]:!r} in URL:', url) - frag = '' + frag = unquote(purl.fragment) if purl.fragment else '' + if frag: up += f'#{purl.fragment}' env = {