Closed Bug 1771423 Opened 2 years ago Closed 2 years ago

Blob channel content type is a little non-standard if type is not set

Categories

(Core :: DOM: File, task, P3)

task

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox105 --- disabled
firefox106 --- disabled
firefox109 --- fixed

People

(Reporter: dlrobertson, Assigned: dlrobertson)

References

Details

Attachments

(1 file, 1 obsolete file)

Given an empty blob with no type set, the Content-Type will be set to application/x-unknown-content.

var blob3 = new Blob([]);
fetch(url).then(function(resp) {
    assert_equals(resp.headers.get("Content-Type"), "application/x-unknown-content-type");
}

See whatwg/fetch#1436 for more details. Chome returns null and Safari returns "".

Assignee: nobody → drobertson

Probably not a high priority, but was something I was interested in fixing (or attempting to fix) as a way to learn more about things.

Set the Content-Type to an empty string for an empty blob when the type was not
given.

Attachment #9278592 - Attachment description: Bug 1771423 - Add test for fetching empty blobs. r=nika,kershaw,smaug → Bug 1771423 - Add test for fetching empty blobs. r=kershaw,smaug
Attachment #9278423 - Attachment description: Bug 1771423 - Set Content-Type to an empty string for an empty blob with no type. r=nika,kershaw,smaug → Bug 1771423 - Set Content-Type to an empty string for an empty blob with no type. r=kershaw,smaug
Priority: -- → P3
Pushed by drobertson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2b7d886f374f Add test for fetching empty blobs. r=kershaw,smaug https://hg.mozilla.org/integration/autoland/rev/c1d1be434427 Set Content-Type to an empty string for an empty blob with no type. r=kershaw,smaug,necko-reviewers
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/35469 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1786128

Backed out from Beta for 105.0b1 for causing bug 1786128. This change is still active in 106+.
https://hg.mozilla.org/releases/mozilla-beta/rev/672222c5bdc8

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/35877 for changes under testing/web-platform/tests
Backout by nfay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/33609bd2549a Backed out 2 changesets for causing webcompat regressions CLOSED TREE

Backed out per request for causing webcompat regressions

Backout link: https://hg.mozilla.org/integration/autoland/rev/33609bd2549a651c42a254d3c314aa28c6856710

Status: RESOLVED → REOPENED
Flags: needinfo?(drobertson)
Resolution: FIXED → ---
Target Milestone: 105 Branch → ---

I'll move the work I was doing in bug 1786128 here.

Flags: needinfo?(drobertson)
Upstream PR merged by moz-wptsync-bot

Web platform tests from the attached patch merged upstream web-platform-tests/wpt#36243.

Attachment #9278592 - Attachment is obsolete: true

Now that whatwg/fetch#1436 and whatwg/fetch#1464 are closed with the tests merged. There is a bit more clarity on how we should handle the empty content type. I'll re-open D147481 with the fix for the regressions listed.

Attachment #9278423 - Attachment description: Bug 1771423 - Set Content-Type to an empty string for an empty blob with no type. r=kershaw,smaug → Bug 1771423 - Set Content-Type to an empty string for an blob with no type. r=kershaw,smaug,Gijs
Pushed by drobertson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/885d79011bc7 Set Content-Type to an empty string for an blob with no type. r=kershaw,smaug,Gijs
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: