bugGNU Wget - Bugs: bug #44628, Wget does not honor RFC 6266 when...

 
 

bug #44628: Wget does not honor RFC 6266 when handling --content-disposition

Submitter:  None
Submitted:  Wed 25 Mar 2015 02:09:19 PM UTC
   
 
Category:  Program Logic Severity:  3 - Normal
Priority:  5 - Normal Status:  Fixed
Privacy:  Public Assigned to:  None
Originator Name:  Yen Chi Hsuan Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Operating System:  GNU/Linux Reproducibility:  Every Time
Fixed Release:  None Planned Release:  None
Regression:  None Work Required:  None
Patch Included:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 15 Aug 2015 07:45:45 AM UTC, comment #3: 

Fixed in commit d03b40e31e9aa06669c3ae0113ed24273e1b60e5

Darshit Shah <darnir>
Group administrator
Wed 25 Mar 2015 02:24:03 PM UTC, comment #2: 

Sorry that I didn't notice that asterisks are parsed as boldface texts. Field names are "filename=" and "filename*=" respectively.

Anonymous
Wed 25 Mar 2015 02:23:48 PM UTC, comment #1: 

Sorry that I didn't notice that asterisks are parsed as boldface texts. Field names are "filename=" and "filename*=" respectively.

Anonymous
Wed 25 Mar 2015 02:09:19 PM UTC, original submission:  

In parse_content_disposition() of src/http.c, filenames in header Content-Disposition is concatenated to form the final name. For an example, see the following download log:

https://gist.githubusercontent.com/yan12125/9c7d0298203995b16235/raw/4e266523861d2c3f0f4df2d76bd7d31f1703d35c/gistfile1.txt

The Google Drive server provides both "filename=" and "filename*=" headers. However, according to a suggestion listed in section 4.3 of RFC 6266 [1], only the value specified by "filename*=" should be used. Here I paste the relevant paragraph:

Many user agent implementations predating this specification do not understand the "filename*" parameter.  Therefore, when both "filename" and "filename*" are present in a single header field value, recipients SHOULD pick "filename*" and ignore "filename". This way, senders can avoid special-casing specific user agents by sending both the more expressive "filename*" parameter, and the "filename" parameter as fallback for legacy recipients (see Section 5 for an example).

As a result, the final filename should be testfile.txt in the above case.

I'm using Arch Linux, and my wget is built from the AUR package wget-git [2].

[1] https://tools.ietf.org/html/rfc6266#section-4.3
[2] https://aur.archlinux.org/packages/wget-git

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by darnir (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-15 darnir StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code