diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py index 0f6d1b2bcd6..76c67e0634a 100644 --- a/aiohttp/web_urldispatcher.py +++ b/aiohttp/web_urldispatcher.py @@ -498,9 +498,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 @@ -654,7 +652,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: @@ -1286,10 +1284,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.