Summary: | REGRESSION (r57544): XMLHttpRequest POSTed multipart/form-data wrongfully gets a charset appended | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Layton Duncan <layton> | ||||
Component: | XML | Assignee: | Alexey Proskuryakov <ap> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ap, commit-queue, cshu, fishd | ||||
Priority: | P1 | Keywords: | InRadar, Regression | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Layton Duncan
2010-06-21 14:57:28 PDT
My reading of XMLHttpRequest2 spec draft is that charset is never appended to Content-Type specified via setRequestHeader(), it's only corrected if it was set incorrectly. "If a Content-Type header is set using setRequestHeader() whose value is a valid MIME type and has a charset parameter whose value is not a case-insensitive match for encoding, and encoding is not null, set all the charset parameters of the Content-Type header to encoding." Created attachment 66149 [details]
proposed fix
The new behavior matches the spec, but doesn't quite match Firefox 3.6.8, which seem to always set a charset (but it sets it as second parameter, right after media type). I think that the spec makes more sense, and it's closer to what Safari 4 was doing.
Comment on attachment 66149 [details] proposed fix View in context: https://bugs.webkit.org/attachment.cgi?id=66149&action=prettypatch > WebCore/xml/XMLHttpRequest.cpp:136 > +static void replaceCharsetInMediaType(String& mediaType, const String& charsetValue) > { > unsigned int pos = 0, len = 0; Declare on separate lines? Comment on attachment 66149 [details] proposed fix Clearing flags on attachment: 66149 Committed r66568: <http://trac.webkit.org/changeset/66568> All reviewed patches have been landed. Closing bug. |