Bug 163538

Summary: [SOUP] Downloads should always sniff contents
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bugs-noreply
Priority: P2 Keywords: Gtk, Soup
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch mcatanzaro: review+

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>