RESOLVED FIXED 155058
Fix file mime-types when using NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=155058
Summary Fix file mime-types when using NetworkSession
Alex Christensen
Reported 2016-03-04 17:34:19 PST
Fix file mime-types when using NetworkSession
Attachments
Patch (4.48 KB, patch)
2016-03-04 17:39 PST, Alex Christensen
no flags
Alex Christensen
Comment 1 2016-03-04 17:39:10 PST
WebKit Commit Bot
Comment 2 2016-03-04 19:30:12 PST
Comment on attachment 273062 [details] Patch Clearing flags on attachment: 273062 Committed r197606: <http://trac.webkit.org/changeset/197606>
WebKit Commit Bot
Comment 3 2016-03-04 19:30:16 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 4 2016-03-05 12:15:30 PST
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?
Note You need to log in before you can comment on or make changes to this bug.