#3556 closed defect (notabug)
Browse: download if HTTP header is Content-Disposition: attachment
Reported by: | manuq | Owned by: | manuq |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | |
Component: | Browse | Version: | Unspecified |
Severity: | Unspecified | Keywords: | 12.1.0, patch |
Cc: | erikos, humitos | Distribution/OS: | Unspecified |
Bug Status: | Unconfirmed |
Description
Browse should always download if HTTP header is Content-Disposition: attachment .
Epiphany code does it in embed/ephy-web-view.c . Is also mentioned in the WebKitGTK documentation for "mime-type-policy-decision-requested" signal.
Attachments (3)
Change History (12)
Changed 11 years ago by humitos
comment:1 Changed 11 years ago by humitos
comment:2 Changed 11 years ago by humitos
- Keywords patch added
Changed 11 years ago by manuq
comment:3 Changed 11 years ago by manuq
Attached new version that applies to current code. We have to find a URL that can be used as testcase.
comment:4 Changed 11 years ago by humitos
This is a valid URL with Content-Disposition: attachment:
- http://bugs.sugarlabs.org/raw-attachment/ticket/3556/0001-Automatically-download-attachment-files-SL-3556.patch
$ curl -I http://bugs.sugarlabs.org/raw-attachment/ticket/3556/0001-Automatically-download-attachment-files-SL-3556.patch HTTP/1.1 200 Ok Date: Wed, 30 May 2012 14:50:14 GMT Server: Apache/2.2.14 (Ubuntu) ETag: W/"anonymous/Fri, 04 May 2012 04:09:03 GMT/False" Content-Disposition: attachment Content-Length: 1528 Last-Modified: Fri, 04 May 2012 04:09:03 GMT Content-Type: text/x-diff; charset=iso-8859-15
Is the patch attached to this ticket :)
comment:5 Changed 11 years ago by humitos
I didn't apply this patch and I could download that file without any problem. Browse didn't ask me about it, it just downloaded the file. I tested this with the latest git version of Browse.
Changed 11 years ago by humitos
comment:6 Changed 11 years ago by manuq
Great testing humitos,
Browse will start a download if it can't handle the mime-type, can you check if text/x-diff can be displayed by Browse?
I also tested some days ago with websites that let you download files, like JPEG files in flickr. And Browse behaves well, starting a donwload instead of showing the file (Browse can handle JPEG). But I thought the site may be using some javascript to force the download, so I didn't post my findings here.
comment:7 Changed 11 years ago by humitos
Oh, sorry. I didn't know about that behavior of Browse. I didn't know that if Browse doesn't know how to manage the file type it will download the file automatically.
... after some test ...
I'm sure WHY this is working without the patch applied. I tested these two cases:
- Click on [this image http://upload.wikimedia.org/wikipedia/commons/5/51/Google.png] (without Content-Disposition: attachment) and Browse shows it on the tab.
- Click on [this image http://bugs.sugarlabs.org/raw-attachment/ticket/3556/Captura%20pantalla%20de%20_Actividad%20Navegar_.png] (with Content-Disposition: attachment) and Browse downloads it automatically.
So, there are nothing to fix here. Close this ticket if you consider that there is no bug here. At least these comments will be useful as documentation :)
comment:8 Changed 11 years ago by manuq
- Resolution set to notabug
- Status changed from new to closed
Thanks humitos.
Yes I will close it now, current behaviour is strange because contradicts the webkitgtk documentation and ephy code deals with Content-Disposition. But I will close as notabug because no one has experienced this issue.
I don't know why but I'm getting a segmentation fault with this patch. I test it in an isolated version (inside an example with a couple of lines) and it works properly.
The problematic line is: