Failure in testing/web-platform/tests/XMLHttpRequest/overridemimetype-blob.html

RESOLVED FIXED in Firefox 55

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: shawnjohnjr, Assigned: shawnjohnjr)

Tracking

unspecified
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(2 attachments, 2 obsolete attachments)

Use text/xml as fallback MIME type	

assert_equals: expected "text/xml" but got "application/xml"


Use text/xml as fallback MIME type, 2	
assert_equals: expected "text/xml" but got "application/xml"


Bogus MIME type should end up as application/octet-stream	
assert_equals: expected "application/octet-stream" but got "application/x-unknown-content-type"


Bogus MIME type should end up as application/octet-stream, 2	
assert_equals: expected "application/octet-stream" but got "text/xml"
Assignee: nobody → shuang
Created attachment 8866157 [details] [diff] [review]
Bug 1362318 - Part1: Use text/xml as fallback response MIME type
Created attachment 8866169 [details] [diff] [review]
Bug 1362318 - Part2: Fallback override MIME type to application/octet-stream
I'm not sure about this case "Bogus MIME type should end up as application/octet-stream, 2".

Based on the specification, "If mime is a parsable MIME type, then set override MIME type to its MIME type portion.".
The xhr specification doesn't mention invalid mime type.

So I think "text/xml;charset=†" is a parsable MIME type, but it's not a valid MIME type, because the parameter 'dagger' (†) character is invalid token.


https://mimesniff.spec.whatwg.org/#parsable-mime-type
A valid MIME type
is a string that matches the media-type rule defined in section 3.1.1.1 "Media Type" of RFC 7231. In particular, a valid MIME type may include parameters. [RFC7231]


     token          = 1*tchar

     tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
                    / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
                    / DIGIT / ALPHA
                    ; any VCHAR, except delimiters

Maybe I'm wrong. Anne, what do you think?
Flags: needinfo?(annevk)

Comment 4

2 years ago
Since the dagger is outside ASCII it cannot be parsed technically I think.
Flags: needinfo?(annevk)
(In reply to Anne (:annevk) from comment #4)
> Since the dagger is outside ASCII it cannot be parsed technically I think.

https://mimesniff.spec.whatwg.org/#parsable-mime-type
Okay, I wonder why they have to distinguish between a parsable MIME type and a valid MIME type.

Comment 6

2 years ago
Sometimes there are differences between what the parser can return and what is actually valid to write.

  <style>body { color:green</style>

parses as

  <style>body { color:green }</style>

but only the latter is valid.

It might not be worth fixing that particular test for now though since I suspect nobody has done sufficient research yet on how MIME types are actually parsed by various browsers.
Attachment #8866157 - Flags: review?(amarchesini)
Attachment #8866169 - Flags: review?(amarchesini)
Attachment #8866157 - Flags: review?(amarchesini) → review+
Attachment #8866169 - Flags: review?(amarchesini) → review+
Attachment #8866157 - Attachment is obsolete: true
Attachment #8866169 - Attachment is obsolete: true
Created attachment 8866598 [details] [diff] [review]
Bug 1362318 - Part1: Use text/xml as fallback response MIME type, r=baku
Created attachment 8866599 [details] [diff] [review]
Bug 1362318 - Part2: Fallback override MIME type to application/octet-stream, r=baku

Comment 10

2 years ago
Pushed by shuang@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5dbfb3a8d5cc
Part1: Use text/xml as fallback response MIME type, r=baku
https://hg.mozilla.org/integration/mozilla-inbound/rev/b99e360725c8
Part2: Fallback override MIME type to application/octet-stream, r=baku

Comment 11

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/5dbfb3a8d5cc
https://hg.mozilla.org/mozilla-central/rev/b99e360725c8
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.