We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae9cdfb commit 94d059aCopy full SHA for 94d059a
app/api/v2/handlers/payload_api.py
@@ -19,7 +19,10 @@
19
20
def _validate_payload_extension(filename: str) -> None:
21
"""Raise HTTPBadRequest if the file extension is on the server-side executable blocklist."""
22
- ext = os.path.splitext(filename)[1].lower()
+ # Normalize the filename so the extension check reflects how it will be stored
23
+ # on filesystems like Windows that ignore trailing dots and spaces.
24
+ normalized = filename.rstrip(". ")
25
+ ext = os.path.splitext(normalized)[1].lower()
26
if ext in _BLOCKED_EXTENSIONS:
27
raise web.HTTPBadRequest(reason=f"File type {ext!r} is not allowed as a payload")
28
0 commit comments