Re: [whatwg/fetch] investigate data: URL quoted parameters (#970)

If you were following RFC 3986

> content-type: application/example;lang="foo,bar"
>
> body

would turn into
> data:application/example;lang=%22foo%2Cbar%22,body
but
> data:application/example;lang=foo%2Cbar,body


would be allowed, because the MIME specification defines quoted strings as equivalent to the string with the initial and final quote omitted.

should also be allowed.

Percent-encoding is used for multiple purposes: it is used to escape (RFC3986) reserved characters to avoid confusion when it is not used for the reserved purpose (such as in this case where the comma is used to delimit the body) and also to encode characters that are (in RFC 3986) not allowed.

To fit into the WHATWG URL standard, though, if double quote is allowed, then
> data:application/example;lang="foo%2Cbar",body
would also be equivalent.

The content-type string is itself a linearization of a data structure which allows surrounding double quotes for parameter values, and requires them when the parameter value contains any character in (RFC 2045) tspecial, which includes 
double quote.

> data:application/example;lang=%22foo%22baz%22,body 

would correspond to

> content-type: application/example;lang="foo"bar"

since quoted string allows embedded " marks.

Section 5 of RFC2397 is "History" and the discussion of "quoted-printable" is about an entirely different topic, explaining the use of base64 value for content-transfer-encoding (see RFC 2045 section 6.1). I imagined you might consider adding some kind of compression values instead of base64, for example.
 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/970#issuecomment-562225573

Received on Thursday, 5 December 2019 17:16:13 UTC