Commit 299b1d04 authored by Jim Fulton's avatar Jim Fulton

Applied patch from Elliot Lee that makes test for file-upload more selective,

in keeping with RFC 1867.
parent d35d2753
......@@ -83,7 +83,7 @@
#
##############################################################################
__version__='$Revision: 1.22 $'[11:-2]
__version__='$Revision: 1.23 $'[11:-2]
import regex, sys, os, string
from string import lower, atoi, rfind, split, strip, join, upper, find
......@@ -317,9 +317,10 @@ class HTTPRequest(BaseRequest):
if (hasattr(item,'file') and hasattr(item,'filename')
and hasattr(item,'headers')):
if (item.file and
(item.filename is not None or
'content-type' in map(lower,
item.headers.keys()))):
(item.filename is not None
# RFC 1867 says that all fields get a content-type.
# or 'content-type' in map(lower, item.headers.keys())
)):
item=FileUpload(item)
else:
item=item.value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment