diff options
author | David Lord <davidism@gmail.com> | 2023-03-03 08:47:31 -0800 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2023-03-03 08:47:31 -0800 |
commit | c3b26d0810719f9604399248a61f999a37dadf76 (patch) | |
tree | cc66e932852d22492bcfcd96b1bf4396dab97a8d /src/werkzeug/utils.py | |
parent | d4ddff63fad160c1e5ab101c7eb5103bef9a101e (diff) | |
download | werkzeug-c3b26d0810719f9604399248a61f999a37dadf76.tar.gz |
deprecate safe_conversion in iri_to_uri
Diffstat (limited to 'src/werkzeug/utils.py')
-rw-r--r-- | src/werkzeug/utils.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/werkzeug/utils.py b/src/werkzeug/utils.py index 7ab0105f..d353b31b 100644 --- a/src/werkzeug/utils.py +++ b/src/werkzeug/utils.py @@ -263,18 +263,14 @@ def redirect( response. The default is :class:`werkzeug.wrappers.Response` if unspecified. """ + from .urls import iri_to_uri + if Response is None: from .wrappers import Response display_location = escape(location) - if isinstance(location, str): - # Safe conversion is necessary here as we might redirect - # to a broken URI scheme (for instance itms-services). - from .urls import iri_to_uri - - location = iri_to_uri(location, safe_conversion=True) - - response = Response( # type: ignore + location = iri_to_uri(location) + response = Response( "<!doctype html>\n" "<html lang=en>\n" "<title>Redirecting...</title>\n" |