Skip to content

Commit

Permalink
Fix: Multipart file uploads with empty filename not detected as binary.
Browse files Browse the repository at this point in the history
  • Loading branch information
defnull committed Jul 7, 2021
1 parent 1522198 commit ed32f36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,11 +1239,11 @@ def POST(self):
self['_cgi.FieldStorage'] = data #http://bugs.python.org/issue18394#msg207958
data = data.list or []
for item in data:
if item.filename:
if item.filename is None:
post[item.name] = item.value
else:
post[item.name] = FileUpload(item.file, item.name,
item.filename, item.headers)
else:
post[item.name] = item.value
return post

@property
Expand Down

0 comments on commit ed32f36

Please sign in to comment.