Bug 137493 - REGRESSION (r173356): Downloading a disk image appends ".txt" to it
Summary: REGRESSION (r173356): Downloading a disk image appends ".txt" to it
Status: RESOLVED DUPLICATE of bug 137855
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-10-07 12:13 PDT by Antti Koivisto
Modified: 2014-10-22 13:18 PDT (History)
1 user (show)

See Also:


Attachments
patch (2.61 KB, patch)
2014-10-07 12:18 PDT, Antti Koivisto
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2014-10-07 12:13:11 PDT
Some downloads gain incorrect .txt extension
Comment 1 Antti Koivisto 2014-10-07 12:13:31 PDT
<rdar://problem/18321947>
Comment 2 Antti Koivisto 2014-10-07 12:18:17 PDT
Created attachment 239424 [details]
patch
Comment 3 Alexey Proskuryakov 2014-10-07 12:33:55 PDT
Comment on attachment 239424 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=239424&action=review

> Source/WebKit2/Shared/Downloads/ios/DownloadIOS.mm:134
> +    // 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.
Comment 4 Antti Koivisto 2014-10-08 05:30:03 PDT
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.
Comment 5 Antti Koivisto 2014-10-16 08:27:19 PDT
http://trac.webkit.org/changeset/174763
Comment 6 Antti Koivisto 2014-10-22 13:18:53 PDT
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 ***