Use the new MimeType parser to parse content-types for response headers
Categories
(Core :: Networking, defect, P2)
Tracking
()
People
(Reporter: twisniewski, Assigned: dotoole)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
We should be able to pass the mimesniff/mime-types/charset-parameter.window.html WPTs if we use our new MIMEType parser here:
We could also pass a lot of the other MimeSniff tests by using it for blob content types, but unfortunately those tests conflict with the File spec (because the File spec expects blobs to only be lowercased and rejected if they have non-ASCII characters, while the MimeSniffing spec seems to expect them to be normalized, as if parsed and then serialized).
Reporter | ||
Updated•11 months ago
|
Reporter | ||
Updated•11 months ago
|
Comment 1•11 months ago
|
||
net_ParseContentType(val, mContentType, mContentCharset, &dummy);
We need to do something like this:
https://searchfox.org/mozilla-central/rev/503938c13ef2dd174705dc0f6d0683ae43074ccc/netwerk/protocol/data/nsDataHandler.cpp#187-194
if (mozilla::UniquePtr<CMimeType> parsed = CMimeType::Parse(mimeType)) {
parsed->GetFullType(aContentType);
if (aContentCharset) {
parsed->GetParameterValue(kCharset, *aContentCharset);
}
if (aMimeType) {
parsed->Serialize(*aMimeType);
}
Reporter | ||
Comment 2•11 months ago
|
||
Note that I actually have a patch in the works here already, but there were still try-failures I haven't accounted for: https://treeherder.mozilla.org/jobs?repo=try&revision=356a369dc72bbecb6f0a525ad7c2dca464a33f27
Description
•