[whatwg/fetch] should Response.blob() type include parameters like charset? (#540)

Writing this issue based on this gecko bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=1362824

To summarize, if you visit this test in different browsers you will get different blob types:

https://bl.ocks.org/jhabdas/87f8bc3573cf91b4c35e0c799addd762

You get:

* Chrome: `text/css`
* Safari: `text/css`
* Yandex: `text/css`
* Firefox: `text/css; charset=utf-8`
* Edge: `text/css; charset=utf-8`

Alternatively, if you run this code in the console in various browsers you get a different set of types:

```
new Response(new URLSearchParams('name=value')).blob().then(b => console.log(b.type))
```

You get:

* chrome: application/x-www-form-urlencoded;charset=utf-8
* safari: application/x-www-form-urlencoded
* firefox: application/x-www-form-urlencoded;charset=utf-8
* edge: does not support URLSearchParams

As you can see, browsers are inconsistent in whether to include the charset param in the `Blob.type` content-type value.  Firefox always includes it.  Safari never includes it.  Chrome sometimes includes it.

What do people think these different cases should do?

Sorry if this should go on a different spec, but behavior seems somewhat dependent on source, so thought fetch might be a reasonable place to start.

-- 
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/540

Received on Tuesday, 9 May 2017 18:45:51 UTC