diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py index ce6f17e7360..25aa846e0a7 100644 --- a/aiohttp/web_urldispatcher.py +++ b/aiohttp/web_urldispatcher.py @@ -474,9 +474,7 @@ def _match(self, path: str) -> Optional[Dict[str, str]]: if match is None: return None else: - return { - key: _unquote_path(value) for key, value in match.groupdict().items() - } + return {key: value for key, value in match.groupdict().items()} def raw_match(self, path: str) -> bool: return self._orig_path == path @@ -627,7 +625,7 @@ async def resolve(self, request: Request) -> _Resolve: if method not in allowed_methods: return None, allowed_methods - match_dict = {"filename": _unquote_path(path[len(self._prefix) + 1 :])} + match_dict = {"filename": path[len(self._prefix) + 1 :]} return (UrlMappingMatchInfo(match_dict, self._routes[method]), allowed_methods) def __len__(self) -> int: @@ -1256,10 +1254,6 @@ def _quote_path(value: str) -> str: return URL.build(path=value, encoded=False).raw_path -def _unquote_path(value: str) -> str: - return URL.build(path=value, encoded=True).path.replace("%2F", "/") - - def _requote_path(value: str) -> str: # Quote non-ascii characters and other characters which must be quoted, # but preserve existing %-sequences.