Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#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)

comment:1 Changed 8 years ago by humitos

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:

content_disposition = message.props.\
                    response_headers.get_content_disposition()

comment:2 Changed 8 years ago by humitos

  • Keywords patch added

comment:3 Changed 8 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 8 years ago by humitos

This is a valid URL with Content-Disposition: attachment:

Is the patch attached to this ticket :)

comment:5 Changed 8 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 8 years ago by humitos

comment:6 Changed 8 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 8 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:

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 8 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.

comment:9 Changed 7 years ago by dnarvaez

  • Milestone 0.96 deleted

Milestone 0.96 deleted

Note: See TracTickets for help on using tickets.