-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds testsMoving the issue forward requires someone to write testsMoving the issue forward requires someone to write teststopic: mime type sniffing
Description
What is the issue with the MIME Sniffing Standard?
In servo/servo#42037 I have updated Servo's mime classifier to handle a style context. It took a bit to figure out what was the magic incantation, but eventually I ended up with something small that appears to be passing WPT:
supplied_type.clone().unwrap_or_else(|| {
if no_sniff_flag == NoSniffFlag::On {
mime::APPLICATION_OCTET_STREAM
} else {
mime::TEXT_CSS
}
})In other words:
- We take the supplied type if it exists
- If it doesn't exist and
nosniffis passed, we return a dummy value - We fallback to
text/css
Note that when an invalid Mime type is passed (text/invalid or broken), then it becomes None, hence we consider it as "doesn't exist".
Not sure what the status of this spec is and whether folks are interested in speccing the "Sniffing in a style context", but hopefully it is useful to know what Servo had to do.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds testsMoving the issue forward requires someone to write testsMoving the issue forward requires someone to write teststopic: mime type sniffing