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

> `data:text/javascript;charset%3DUTF-8,`

The ABNF is `parameter  := attribute "=" value` (i.e., with a literal `=`), so that's invalid and specifically distinct from `data:text/javascript;charset=UTF-8;`. Percent-decoding in data: URLs applies between defined delimiters, not before identifying them.

> `data:text/javascript;charset="UTF%5C-8",`

If https://www.rfc-editor.org/errata/eid5923 is accepted, that will also be invalid. But right now, an argument could be made that it corresponds to `Content-Type: text/javascript; charset="UTF\-8"` (which, per the rules of `quoted-pair`, has a charset parameter value of "UTF-8" anyway).

> `data:text/javascript;charset="charset=UTF-8%22,`

Likewise here, except that the argument before https://www.rfc-editor.org/errata/eid5923 would be a correspondence with `Content-Type: text/javascript; charset="charset=UTF-8"`.

> I'm inclined to close this as I don't think there's an issue with Fetch. If there's a test demonstrating otherwise please do say.

@annevk Given how its algorithms seem to ignore these media type parameters for all purposes other than echoing them back (and in particular uses UTF-8 regardless of `charset`), I think Fetch can be left as-is and the necessary processing applied in higher levels (albeit redundantly so). **However**, there certainly are browser-inconsistent bugs from failure to properly percent-decode per RFC 2397: https://jsfiddle.net/7m5dtuk6/

-- 
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-560828541

Received on Monday, 2 December 2019 22:59:33 UTC