case-insensitive comparison

This commit is contained in:
David Lord 2026-05-01 20:53:36 -07:00
parent 06ea505ce2
commit 9368fb3f3c
No known key found for this signature in database
GPG key ID: 43368A7AA8CC5926
2 changed files with 6 additions and 1 deletions

View file

@ -534,6 +534,9 @@ class App(Scaffold):
"""Returns ``True`` if autoescaping should be active for the given
template name. If no template name is given, returns `True`.
.. versionchanged:: 3.2
Use case-insensitive comparison instead of only lower case.
.. versionchanged:: 2.2
Autoescaping is now enabled by default for ``.svg`` files.
@ -541,7 +544,7 @@ class App(Scaffold):
"""
if filename is None:
return True
return filename.endswith((".html", ".htm", ".xml", ".xhtml", ".svg"))
return filename.lower().endswith((".html", ".htm", ".xml", ".xhtml", ".svg"))
@property
def debug(self) -> bool: