Bug 163538 - [SOUP] Downloads should always sniff contents
Summary: [SOUP] Downloads should always sniff contents
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, Soup
Depends on:
Blocks:
 
Reported: 2016-10-17 03:30 PDT by Carlos Garcia Campos
Modified: 2016-10-17 03:54 PDT (History)
2 users (show)

See Also:


Attachments
Patch (6.51 KB, patch)
2016-10-17 03:33 PDT, Carlos Garcia Campos
mcatanzaro: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2016-10-17 03:30:06 PDT
It's quite common that downloads have weird filenames with no extension, so it would be better if the loader sniff the contents to guess the mime type.
Comment 1 Carlos Garcia Campos 2016-10-17 03:33:04 PDT
Created attachment 291806 [details]
Patch
Comment 2 Michael Catanzaro 2016-10-17 03:49:48 PDT
Comment on attachment 291806 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:640
> +    g_assert_cmpstr(webkit_uri_response_get_mime_type(response), ==, "application/pdf");

So what did you actually do? Does this function call fail without your change?
Comment 3 Carlos Garcia Campos 2016-10-17 03:53:06 PDT
(In reply to comment #2)
> Comment on attachment 291806 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=291806&action=review
> 
> > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:640
> > +    g_assert_cmpstr(webkit_uri_response_get_mime_type(response), ==, "application/pdf");
> 
> So what did you actually do? Does this function call fail without your
> change?

The assert fails, because the returned mime type is not application/pdf
Comment 4 Carlos Garcia Campos 2016-10-17 03:54:53 PDT
Committed r207405: <http://trac.webkit.org/changeset/207405>