cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Content-Disposition parser confirming to RFC 6266

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 29 Oct 2012 23:01:42 +0100 (CET)

On Sat, 27 Oct 2012, Tatsuhiro Tsujikawa wrote:

> I'd like to contribute a patch to add Content-Disposition parser conforming
> to RFC 6266. The comment in tool_cd_hdr.c says it does not support encoded
> filenames (*=) right now.

That sounds awesome!

> I observed that curl does not decode percent-encoded filename in URL with -O
> option. So the safe and consistent way is probably preserve percent-encoded
> string as is and do usual sanitizing (i.e., use string after last /). The
> drawback of this approach is user does not know the charset of the string
> when it is decoded.

The -O option without -J or with -J but without a Content-Disposition header
use the file name portion as-is from the URL. I really don't think it should
attempt to decode it to anything then as it A) really doesn't know what
charset to use and B) never did it before so it would introduce a modified
behavior that will ruin lots of scripts out there.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-10-29