Bug 15287 - WebKit does not support non ascii parameters defined in RFC2231
: WebKit does not support non ascii parameters defined in RFC2231
Status: CLOSED INVALID
Product: WebKit
Classification: Unclassified
Component: New Bugs
: 523.x (Safari 3)
: Macintosh Mac OS X 10.4
: P2 Normal
Assigned To: Nobody
: InRadar
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-26 08:51 PDT by Nir Soffer
Modified: 2010-09-17 08:11 PDT (History)
4 users (show)

See Also:


Attachments
CGI script demonstrating the problem (213 bytes, text/plain)
2007-09-26 08:56 PDT, Nir Soffer
no flags Details
Fixed test case (201 bytes, text/plain)
2008-08-16 12:37 PDT, Nir Soffer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nir Soffer 2007-09-26 08:51:29 PDT
WebKit based browsers do not support headers with non-ASCII parameters according to RFC 2231 <http://www.ietf.org/rfc/rfc2231.txt>. This format is supported by Firefox.

Related:
 - http://moinmo.in/MoinMoinBugs/Non_ASCII_attachments_names_corrupted_on_download
Comment 1 Nir Soffer 2007-09-26 08:56:28 PDT
Created attachment 16398 [details]
CGI script demonstrating the problem

To reproduce:
 1. Install script
 2. Access 
 3. File > Save As

Result: file name is download.py
Expected: file name should be עברית

Another way:
 1. Add link to this script in another html document, e.g. <a href="cgi-bin/download.py">download</a>
 2. Right click the link and choose "Download linked file"

Result: download to file "download.py"
Expected: download to file "עברית"

Firefox give expected result in both cases.
Comment 2 Mark Rowe (bdash) 2007-09-26 09:20:46 PDT
<rdar://problem/5475999>
Comment 3 Mark Rowe (bdash) 2007-09-26 09:23:43 PDT
The changes required to support this completely need to be implemented at a lower level than WebKit.  This work is being tracked by the associated Radar.  I'm going to close this bug as INVALID as the issue is not at the WebKit level.

Thanks for the bug report.
Comment 4 Alexey Proskuryakov 2007-09-26 11:50:37 PDT
See also: rdar://4727992
Comment 5 Julian Reschke 2008-06-20 02:34:21 PDT
It would be great if somebody could update this bug with information about how work on rdar://4727992 is progressing.

Comment 6 Mark Rowe (bdash) 2008-06-20 03:52:18 PDT
As it is not a WebKit bug it is not appropriate for us to publish information about it in the WebKit bug database.
Comment 7 Mark Rowe (bdash) 2008-08-15 16:54:10 PDT
*** Bug 20407 has been marked as a duplicate of this bug. ***
Comment 8 Julian Reschke 2008-08-16 02:10:39 PDT
regarding comment 1 and it's attachment...

The test case is incorrect. It uses

  filename*="utf-8'en'%D7%A2%D7%91%D7%A8%D7%99%D7%AA"

while it should be

  filename*=utf-8'en'%D7%A2%D7%91%D7%A8%D7%99%D7%AA

according to the "extended-initial-value" production in Section 7 of RFC 2231 (<http://greenbytes.de/tech/webdav/rfc2231.html#rfc.section.7>)
Comment 9 Nir Soffer 2008-08-16 12:37:43 PDT
Created attachment 22834 [details]
Fixed test case

This test case does not work with Safari 3.1.2 and Mac OS X 10.4.11, but works with Firefox 2 on same system.
Comment 10 Alexey Proskuryakov 2008-08-16 13:26:17 PDT
(In reply to comment #8)
>   filename*="utf-8'en'%D7%A2%D7%91%D7%A8%D7%99%D7%AA"
>   filename*=utf-8'en'%D7%A2%D7%91%D7%A8%D7%99%D7%AA

AFAICT, these only differ in that the original one has quotation marks.

Could you please clarify why they are no allowed? It is strange to me because (1) extended-initial-value is not referenced anywhere else in RFC 2231, so formally speaking, it does not mean anything; and (2) RFC 2231 itself has an example that uses quoted strings:

   Content-Type: application/x-stuff
    title*0*=us-ascii'en'This%20is%20even%20more%20
    title*1*=%2A%2A%2Afun%2A%2A%2A%20
    title*2="isn't it!"

Does the variant with quotations marks work in other browsers?
Comment 11 Julian Reschke 2008-08-17 05:52:29 PDT
> AFAICT, these only differ in that the original one has quotation marks.

Yes.

> Could you please clarify why they are no allowed? It is strange to me because
> (1) extended-initial-value is not referenced anywhere else in RFC 2231, so

That's a known erratum, see http://www.rfc-editor.org/errata_search.php?eid=477.

> formally speaking, it does not mean anything; and (2) RFC 2231 itself has an
> example that uses quoted strings:

But not in the initial value.

> Does the variant with quotations marks work in other browsers?

I'm going to test it, but I'm really not sure why it would matter. The spec is there for a reason.
Comment 12 Julian Reschke 2008-08-23 09:31:30 PDT
More test cases: <http://greenbytes.de/tech/rfc2231/>

Proposed profile for use of RFC2231 encoding in HTTP: <http://greenbytes.de/tech/webdav/draft-reschke-rfc2231-in-http-latest.html>
Comment 13 Nir Soffer 2008-08-31 19:11:24 PDT
(In reply to comment #12)
> More test cases: <http://greenbytes.de/tech/rfc2231/>
http://greenbytes.de/tech/tc2231/
Comment 14 Julian Reschke 2010-09-17 08:11:58 PDT
In the meantime, draft-reschke-rfc2231-in-http has been published as IETF RFC 5987 on the standards track.