Summary: | [SOUP] Ensure a response MIME type when Content-Type is missing and sniffing not allowed | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | bugs-noreply | ||||
Priority: | P2 | Keywords: | LayoutTestFailure, Soup | ||||
Version: | WebKit Local Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Carlos Garcia Campos
2017-02-14 02:52:31 PST
Created attachment 301481 [details]
Patch
Comment on attachment 301481 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=301481&action=review > Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp:334 > + } What about just adding if (m_response.mimeType().isEmpty() && m_soupMessage->status_code != SOUP_STATUS_NOT_MODIFIED) m_response.setMimeType(MIMETypeRegistry::getMIMETypeForPath(m_response.url().path())); to the previous code? I prefer that option because it clearly shows that the call to updateFromSoupMessage is unconditional. Comment on attachment 301481 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=301481&action=review >> Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp:334 >> + } > > What about just adding > > if (m_response.mimeType().isEmpty() && m_soupMessage->status_code != SOUP_STATUS_NOT_MODIFIED) > m_response.setMimeType(MIMETypeRegistry::getMIMETypeForPath(m_response.url().path())); > > to the previous code? I prefer that option because it clearly shows that the call to updateFromSoupMessage is unconditional. Yes, I thought about that, and I didn't do it to avoid checking 304 twice, but it's not a big deal anyway. I'll update it before landing, thanks for the review. Committed r212286: <http://trac.webkit.org/changeset/212286> |