replace werkzeug.urls with urllib.parse

This commit is contained in:
David Lord 2023-03-11 08:16:19 -08:00
parent e7f8ae0166
commit c4b39ba2f3
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 13 additions and 4 deletions

View file

@ -11,6 +11,7 @@ from datetime import timedelta
from itertools import chain
from threading import Lock
from types import TracebackType
from urllib.parse import quote as _url_quote
import click
from werkzeug.datastructures import Headers
@ -27,7 +28,6 @@ from werkzeug.routing import RequestRedirect
from werkzeug.routing import RoutingException
from werkzeug.routing import Rule
from werkzeug.serving import is_running_from_reloader
from werkzeug.urls import url_quote
from werkzeug.utils import redirect as _wz_redirect
from werkzeug.wrappers import Response as BaseResponse
@ -2034,7 +2034,8 @@ class Flask(Scaffold):
return self.handle_url_build_error(error, endpoint, values)
if _anchor is not None:
rv = f"{rv}#{url_quote(_anchor)}"
_anchor = _url_quote(_anchor, safe="%!#$&'()*+,/:;=?@")
rv = f"{rv}#{_anchor}"
return rv