Summary: | Fix file mime-types when using NetworkSession | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||
Component: | New Bugs | Assignee: | Alex Christensen <achristensen> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue | ||||
Priority: | P2 | ||||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Alex Christensen
2016-03-04 17:34:19 PST
Created attachment 273062 [details]
Patch
Comment on attachment 273062 [details] Patch Clearing flags on attachment: 273062 Committed r197606: <http://trac.webkit.org/changeset/197606> All reviewed patches have been landed. Closing bug. Comment on attachment 273062 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=273062&action=review > Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:100 > + if (shouldContentSniff == WebCore::DoNotSniffContent || url.protocolIs("file")) { At other call sites we use url.isLocalFile() rather than url.protocolIs("file"). I think we should do that here. > Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm:174 > + // Avoid MIME type sniffing if the response comes back as 304 Not Modified. > + int statusCode = [response respondsToSelector:@selector(statusCode)] ? [(id)response statusCode] : 0; > + if (statusCode != 304) > + WebCore::adjustMIMETypeIfNecessary(response._CFURLResponse); Comment is unclear because “adjustMIMETypeIfNecessary” does not seem to be the same thing as “MIME type sniffing”. Maybe we should rename something or change the comment a bit? Is 304 the *only* response where we don’t want to do sniffing? If so, why is it just that one? |