[whatwg/fetch] blob url fetch with no mime type set is undefined (Issue #1436)

I could be mistaken, but I couldn't find anything that specifies what should be returned when we fetch a blob url that is backed by a blob, but the mime type was not set. I wanted to add a test like the following to https://github.com/web-platform-tests/wpt/pull/33941, but each engine returns a different value for the mime type.

```
diff --git a/fetch/api/basic/scheme-blob.sub.any.js b/fetch/api/basic/scheme-blob.sub.any.js
index 6e63cbecaa..b25b412507 100644
--- a/fetch/api/basic/scheme-blob.sub.any.js
+++ b/fetch/api/basic/scheme-blob.sub.any.js
@@ -2,7 +2,9 @@
 
 function checkFetchResponse(url, data, mime, size, desc) {
   promise_test(function(test) {
-    size = size.toString();
+    if (size !== null) {
+      size = size.toString();
+    }
     return fetch(url).then(function(resp) {
       assert_equals(resp.status, 200, "HTTP status is 200");
       assert_equals(resp.type, "basic", "response type is basic");
@@ -42,4 +44,8 @@ invalidRequestMethods.forEach(function(method) {
   checkKoUrl(URL.createObjectURL(blob2), method, "Fetching [" + method + "] URL.createObjectURL(blob) is KO");
 });
 
+var blob3 = new Blob([]);
+checkFetchResponse(URL.createObjectURL(blob3), "", "application/x-unknown-content-type", null,
+                  "Fetching [GET] URL.createObjectURL(blob3) is OK");
+
 done();
```

|`Content-Type` value |browser|
|:-:|:-:|
|`application/x-unknown-content-type`|firefox|
|`null`|chrome|
|`""`|safari|

Please let me know if I've missed something!

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

Message ID: <whatwg/fetch/issues/1436@github.com>

Received on Thursday, 5 May 2022 03:12:07 UTC