Open Bug 601240 Opened 14 years ago Updated 2 years ago

Content-Type invalid for file input (multipart/form-data). It is quoted.

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect

Tracking

()

UNCONFIRMED

People

(Reporter: russ, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100915 Ubuntu/10.04 (lucid) Firefox/3.6.10 Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 When uploading a file on the Mac w/ Firefox 3.6 the content type for zip file is quoted. According to http://tools.ietf.org/rfc/rfc2045.txt it doesn't appear it should be quoted since the ASCII quote is a tspecials character. Found this related discussion w/ google: http://codeigniter.com/forums/viewthread/86033/ Reproducible: Always Steps to Reproduce: 1. Upload a zip file (maybe any file) via a HTML form 2. Examine the post data 3. Look for the content-type field of the file input. It will be quoted. It shouldn't be. Actual Results: POST DATA Content-Type: multipart/form-data; boundary=---------------------------43609456913856101151027527666 Content-Length: 94283 [snip] -----------------------------43609456913856101151027527666 Content-Disposition: form-data; name="cms_872_file_4"; filename="Archive2.zip" Content-Type: "application/x-zip" [snip] Expected Results: POST DATA Content-Type: multipart/form-data; boundary=---------------------------43609456913856101151027527666 Content-Length: 94283 [snip] -----------------------------43609456913856101151027527666 Content-Disposition: form-data; name="cms_872_file_4"; filename="Archive2.zip" Content-Type: application/x-zip [snip] RFC 2045 Internet Message Bodies November 1996 5.1. Syntax of the Content-Type Header Field In the Augmented BNF notation of RFC 822, a Content-Type header field value is defined as follows: content := "Content-Type" ":" type "/" subtype *(";" parameter) ; Matching of media type and subtype ; is ALWAYS case-insensitive. type := discrete-type / composite-type discrete-type := "text" / "image" / "audio" / "video" / "application" / extension-token composite-type := "message" / "multipart" / extension-token extension-token := ietf-token / x-token ietf-token := <An extension token defined by a standards-track RFC and registered with IANA.> x-token := <The two characters "X-" or "x-" followed, with no intervening white space, by any token> subtype := extension-token / iana-token iana-token := <A publicly-defined extension token. Tokens of this form must be registered with IANA as specified in RFC 2048.> parameter := attribute "=" value attribute := token ; Matching of attributes ; is ALWAYS case-insensitive. value := token / quoted-string token := 1*<any (US-ASCII) CHAR except SPACE, CTLs, or tspecials> tspecials := "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / <"> "/" / "[" / "]" / "?" / "=" ; Must be in quoted-string, ; to use within parameter values
Component: General → HTML: Form Submission
Product: Firefox → Core
QA Contact: general → form-submission
Russ, can you please do the following? Quit Firefox. In a Terminal window, run: env NSPR_LOG_FILE=/tmp/log.txt NSPR_LOG_MODULES=HelperAppService:5 /path/to/Firefox3.6.app/Contents/MacOS/firefox-bin Then reproduce the bug and attach /tmp/log.txt to this bug report? In particular, the form submission code does NOT add the quotes you see, as far as I can tell. Which means something is determining that the type of that file is '"application/zip"' (including the double-quotes). Note that we don't do validation of the syntax for the content-type; nothing in that RFC says someone can't register a type with a major type of '"application' with the IANA, and we don't actually check with the registry. The only question is what on your Mac claims this bogus type for zip files...
Attached file Requested log
Attached requested log (HelperAppService).
Component: HTML: Form Submission → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: