Skip to content

Commit

Permalink
secure_filename looks for more Windows reserved file names (#2623)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Mar 18, 2023
2 parents 36cea62 + 5d069e5 commit 92c6380
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -73,6 +73,7 @@ Unreleased
:pr:`2620`
- The development server discards header keys that contain underscores ``_``, as they
are ambiguous with dashes ``-`` in WSGI. :pr:`2621`
- ``secure_filename`` looks for more Windows reserved file names. :pr:`2622`


Version 2.2.3
Expand Down
15 changes: 5 additions & 10 deletions src/werkzeug/utils.py
Expand Up @@ -31,19 +31,14 @@

_entity_re = re.compile(r"&([^;]+);")
_filename_ascii_strip_re = re.compile(r"[^A-Za-z0-9_.-]")
_windows_device_files = (
_windows_device_files = {
"CON",
"AUX",
"COM1",
"COM2",
"COM3",
"COM4",
"LPT1",
"LPT2",
"LPT3",
"PRN",
"AUX",
"NUL",
)
*(f"COM{i}" for i in range(10)),
*(f"LPT{i}" for i in range(10)),
}


class cached_property(property, t.Generic[_T]):
Expand Down

0 comments on commit 92c6380

Please sign in to comment.