[Webkit-unassigned] [Bug 225226] Blob contentType with charset renders html as plain text

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 4 13:59:33 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=225226

--- Comment #10 from Chris Dumez <cdumez at apple.com> ---
(In reply to Chris Dumez from comment #9)
> (In reply to Chris Dumez from comment #8)
> > Interesting finding, if I use 'text/html' as blob content type instead of
> > 'text/html; charset=UTF-8' then it works as expected.
> 
> Question for Youenn & Alex, isn't this a surprising result?
> Content-Type header: text/html; charset=utf-8, ResourceResponse::mimeType():
> text/html; charset=utf-8
> 
> I would have expected ResourceResponse::mimeType() to have returned
> "text/html", without the charset. I think we rely on CFNetwork to retrieve
> the response's MIME type so I am wondering is this could be due a CFNetwork
> change?

Oh, I suspect this line is wrong in NetworkDataTaskBlob::dispatchDidReceiveResponse():
    ResourceResponse response(m_firstRequest.url(), errorCode != Error::NoError ? "text/plain" : m_blobData->contentType(), errorCode != Error::NoError ? 0 : m_totalRemainingSize, String());

It is passing m_blobData->contentType() as a MIME type to the ResourceResponse constructor.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210504/32e8fcdc/attachment.htm>


More information about the webkit-unassigned mailing list