RESOLVED FIXED 98137
[XMLHttpRequest] overrideMimeType(mime) does not update the response's "Content-Type" header
https://bugs.webkit.org/show_bug.cgi?id=98137
Summary [XMLHttpRequest] overrideMimeType(mime) does not update the response's "Conte...
Chris Dumez
Reported 2012-10-02 03:33:48 PDT
As per the specification (http://www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-overridemimetype): """ client.overrideMimeType(mime) Sets the Content-Type header for the response to mime. """ However, with the current implementation, calling getResponseHeader("Content-Type") does not reflect the mime type passed to overrideMimeType(). Firefox behaves according the spec.
Attachments
Patch (5.02 KB, patch)
2012-10-02 03:40 PDT, Chris Dumez
no flags
Patch (4.96 KB, patch)
2012-10-02 04:35 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2012-10-02 03:40:57 PDT
Kentaro Hara
Comment 2 2012-10-02 04:14:18 PDT
Comment on attachment 166656 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=166656&action=review > LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html:5 > + <script> Nit: I don't know the convention of xhr tests, but we are likely to write the main <script> and <script src="/js-test-resources/js-test-post.js"> at the end of <body>. > LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html:32 > + <div id="description"></div> > + <div id="console"></div> Nit: These are not needed. They will be added automatically. > Source/WebCore/ChangeLog:13 > + returned by client.getResponseHeader("Content-Type"). This patch makes sure > + the response's "Content-Type" header is properly updated with the override > + MIME type. This change looks reasonable, but would you just check cross-browser compatibility just in case (i.e. the behavior of Firefox, Opera and IE)?
Chris Dumez
Comment 3 2012-10-02 04:35:27 PDT
Created attachment 166665 [details] Patch Take Haraken's feedback into consideration. Firefox behaves according to spec (matches the behavior with this patch). Opera does not. I don't have Internet Explorer to test.
Kentaro Hara
Comment 4 2012-10-02 04:36:34 PDT
Comment on attachment 166665 [details] Patch OK, thanks for the clarification!
WebKit Review Bot
Comment 5 2012-10-02 05:46:27 PDT
Comment on attachment 166665 [details] Patch Clearing flags on attachment: 166665 Committed r130158: <http://trac.webkit.org/changeset/130158>
WebKit Review Bot
Comment 6 2012-10-02 05:46:32 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.