Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#192 closed defect (fixed)

FileUploads with builtin HTTPServer and wsgi-handler won't works

Reported by: mordaha@… Owned by: adrian
Component: Core (Other) Version: 1.1
Severity: major Keywords: file upload
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by adrian)

utils/, Line 40:
    msg = email.message_from_string(raw_message) # ***
    POST = datastructures.MultiValueDict()
    FILES = datastructures.MultiValueDict()
    for submessage in msg.get_payload():
        if isinstance(submessage, email.Message.Message): # ****


msg.is_multipart() at (*) marker is always False (coz raw_message haven't content-type header, look at core/handlers/, Line 31), so msg.get_payload() at () is always a String, not email.Message !

Change History (3)

comment:1 Changed 10 years ago by mordaha@…

The solution is to add after Line 32 in core/handlers/

header_dictContent-Type? = self.environ.get('CONTENT_TYPE', )

comment:2 Changed 10 years ago by adrian

  • Description modified (diff)

comment:3 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [476]) Fixed #192 -- File uploads now work with built-in Web server. Thanks, mordaha@…

Note: See TracTickets for help on using tickets.
Back to Top