Bug 189465 - XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header
Summary: XMLHttpRequest: overrideMimeType should not update the response's "Content-Ty...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-09-09 11:53 PDT by Rob Buis
Modified: 2018-09-10 01:29 PDT (History)
4 users (show)

See Also:


Attachments
Patch (4.83 KB, patch)
2018-09-09 11:58 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (6.55 KB, patch)
2018-09-09 12:27 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (7.06 KB, patch)
2018-09-10 00:06 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (7.07 KB, patch)
2018-09-10 00:47 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2018-09-09 11:53:49 PDT
From the spec:
Acts as if the `Content-Type` header value for response is mime. (It does not actually change the header though.)
https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype
Comment 1 Rob Buis 2018-09-09 11:58:21 PDT
Created attachment 349289 [details]
Patch
Comment 2 Rob Buis 2018-09-09 12:27:02 PDT
Created attachment 349291 [details]
Patch
Comment 3 Frédéric Wang (:fredw) 2018-09-09 23:40:28 PDT
Comment on attachment 349291 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=349291&action=review

> Source/WebCore/ChangeLog:9
> +        response's "Content-Type" header anymore.

Are you able to provide a link to a spec change (github issue or something) showing that change?

> Source/WebCore/xml/XMLHttpRequest.cpp:-969
> -        m_response.setHTTPHeaderField(HTTPHeaderName::ContentType, m_mimeTypeOverride);

Can you please also remove the FIXME comment from XMLHttpRequest::didReceiveData? (I guess setting the m_responseEncoding from m_mimeTypeOverride is still valid, right?).
Comment 4 Rob Buis 2018-09-10 00:06:27 PDT
Created attachment 349296 [details]
Patch
Comment 5 Frédéric Wang (:fredw) 2018-09-10 00:33:33 PDT
For reference,

"Acts as if the `Content-Type` header value for response is mime. (It does not actually change the header though.)"

was added in

https://github.com/whatwg/xhr/commit/121cee50b6f51215f046266642964b4c53a02a7c
Comment 6 WebKit Commit Bot 2018-09-10 00:35:23 PDT
Comment on attachment 349296 [details]
Patch

Rejecting attachment 349296 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 349296, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in LayoutTests/ChangeLog contains OOPS!.

Full output: https://webkit-queues.webkit.org/results/9158067
Comment 7 Rob Buis 2018-09-10 00:47:39 PDT
Created attachment 349299 [details]
Patch
Comment 8 WebKit Commit Bot 2018-09-10 01:28:09 PDT
Comment on attachment 349299 [details]
Patch

Clearing flags on attachment: 349299

Committed r235844: <https://trac.webkit.org/changeset/235844>
Comment 9 WebKit Commit Bot 2018-09-10 01:28:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2018-09-10 01:29:22 PDT
<rdar://problem/44295412>