Some downloads gain incorrect .txt extension
Created attachment 239424 [details]
Comment on attachment 239424 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=239424&action=review
> + // FIXME: For some reason the filename needs to be accessed or it may be incorrect after
> + // CFURLResponse is serialized/deserialized (gains .txt extension)
> + response.suggestedFilename();
The fix looks OK to me, although mysterious.
Antti is going to look into whether this can be tested with <iframe src="resources/image.dmg"> - we do log suggested file names in WKTR.
Looks like this can't be tested with reasonable effort. The existing test code for file names runs in policy delegates for the original response. The bug occurs afterwards, when converting the load to download and doing IPC to UI process.
The bug is somehow related to the CFNetwork heuristics for figuring out a file name from URL when Content-Disposition header is not present.
Reverted in http://trac.webkit.org/changeset/175064. Turns out the root cause is in the MIME type sniffing.
*** This bug has been marked as a duplicate of bug 137855 ***