Bug 172442

Summary: [GTK] Blob download doesn't work
Product: WebKit Reporter: ManDay <manday>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bugs-noreply, buildbot, cgarcia, clopez, gustavo, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch clopez: review+

Description ManDay 2017-05-22 04:50:52 PDT
For an example, try to "Export Route" (download button in the left-hand menu) from osm routing service:

https://www.openrouteservice.org/directions?a=50.774209,6.08443,50.395442,5.936762&b=0&c=0&k1=en-US&k2=km

MiniBrowser will report "Download failed: Load request cancelled"
Comment 1 Carlos Garcia Campos 2017-06-11 01:47:44 PDT
I've found the problem, and it's not a Soup issue (soup is not even used for Blobs), but GTK+ specific one. The problem is that GTK+ API uses URIs for download destination paths, and passes that uris to the WebKit internals. But WebKit expects download destination location to be a local path. This is not a problem for normal downloads, because the soup backend handles the cases of download destination being a URI and a path. For blob downloads NetworkDataTaskBlob is used, and it always expects the download destination to be a local path, failing in FileSystem::openFile() when a URI is passed. We need to keep using local files internally and convert to URIs only when exposing those paths to the API.
Comment 2 Carlos Garcia Campos 2017-06-11 01:53:17 PDT
Created attachment 312598 [details]
Patch
Comment 3 Build Bot 2017-06-11 01:54:36 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 4 ManDay 2017-06-13 10:38:07 PDT
Thank you Carlos, tested with Openrouteservice the Blob downloads now work in Minibrowser.
Comment 5 Carlos Garcia Campos 2017-06-13 10:41:32 PDT
But the patch hasn't landed, do not close bugs with unreviewed patches, please.
Comment 6 Carlos Garcia Campos 2017-06-13 10:55:36 PDT
Committed r218185: <http://trac.webkit.org/changeset/218185>