Fetching a Blob with no MIME type set spec/interop issue

8 views
Skip to first unread message

Domenic Denicola

unread,
Sep 27, 2022, 2:38:05 AM9/27/22
to stora...@chromium.org, blink-ne...@chromium.org
Hi folks,

We got a request from Anne to engage on this GitHub issue. All three browsers do different things when looking at the Content-Type header of the Response object returned when fetch()ing a Blob() created with no MIME type.

I'm not sure we have any strong opinions, but if we're willing to align with the current favorite of Safari's approach (an empty string), having someone from Chromium say that publicly would help move the spec process along. (Of course, if we have strong opinions, those are also welcome.)

Best,
Domenic

Ayu Ishii

unread,
Oct 3, 2022, 7:26:15 PM10/3/22
to storage-dev, Domenic Denicola, blink-ne...@chromium.org
Hey Domenic,

Thanks for bringing this up.
No strong opinions from the storage team, aligning with Safari sounds good to us.
Responded to the github issue.

Best,
Ayu

Domenic Denicola

unread,
Oct 3, 2022, 9:04:48 PM10/3/22
to Ayu Ishii, storage-dev, Domenic Denicola, blink-ne...@chromium.org
Thanks so much!

guest271314

unread,
Oct 4, 2022, 12:03:21 AM10/4/22
to Ayu Ishii, storage-dev, Domenic Denicola, blink-ne...@chromium.org
If I read the GitHub issue correctly, Firefox 105 returns "text/plain; charset=utf-8", Chromium 108 Dev Channel returns "text/html; charset=utf-8" when running this at console

var blob = new Blob([]);
var url = URL.createObjectURL(blob);
fetch(blob).then((r) => r.headers.get('content-type'))
.then(console.log, console.error);

The "text/plain" I can understand, an empty string. I don't understand "text/html".

I don't know how"application/x-unknown-content-type" got returned anywhere in the test in the GitHub issue. Are you sure that is what is returned by Firefox; it looks like that was just a parameter passed to the function?

I don't think the browser should return an empty string when it doesn't recognize the MIME type. I haven't seen that brought up; mentioning here so whatever decision is made re no MIME type overflows to unrecognized MIME type get converted to empty string.

--
You received this message because you are subscribed to the Google Groups "blink-network-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-network-...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-network-dev/46e55939-43ab-4ab4-be47-33c06660e241n%40chromium.org.

guest271314

unread,
Oct 4, 2022, 12:06:31 AM10/4/22
to Ayu Ishii, storage-dev, Domenic Denicola, blink-ne...@chromium.org
Ah, I was fetching the Blob, not the ObjectURL. null for Chromium 108, application/x-unknown-content-type for Firefox 105.

On Mon, Oct 3, 2022 at 4:26 PM Ayu Ishii <ay...@chromium.org> wrote:
--
Reply all
Reply to author
Forward
0 new messages