Skip to content

Commit ed32f36

Browse files
committed
Fix: Multipart file uploads with empty filename not detected as binary.
1 parent 1522198 commit ed32f36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bottle.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,11 +1239,11 @@ def POST(self):
12391239
self['_cgi.FieldStorage'] = data #http://bugs.python.org/issue18394#msg207958
12401240
data = data.list or []
12411241
for item in data:
1242-
if item.filename:
1242+
if item.filename is None:
1243+
post[item.name] = item.value
1244+
else:
12431245
post[item.name] = FileUpload(item.file, item.name,
12441246
item.filename, item.headers)
1245-
else:
1246-
post[item.name] = item.value
12471247
return post
12481248

12491249
@property

0 commit comments

Comments
 (0)