Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sniffing of HTML #192

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Remove sniffing of HTML #192

merged 1 commit into from
Jul 15, 2024

Conversation

annevk
Copy link
Member

@annevk annevk commented Jul 4, 2024

As no user agent today appears to identify a text/html resource starting with <rss as XML, remove those rules from the standard.

At the same time, make it more clear that XML (and now HTML) are never sniffed. This is a non-normative change for clarity.

Tests: web-platform-tests/wpt#47002.

Closes #173.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

As no user agent today appears to identify a text/html resource starting with <rss as XML, remove those rules from the standard.

At the same time, make it more clear that XML (and now HTML) are never sniffed. This is a non-normative change for clarity.

Tests: TBD.

Closes #173.
annevk added a commit to web-platform-tests/wpt that referenced this pull request Jul 4, 2024
@annevk annevk requested review from GPHemsley and domenic July 4, 2024 12:36
If the <a>supplied MIME type</a>'s <a for="MIME type">essence</a> is "<code>text/html</code>",
execute the <a>rules for distinguishing if a resource is a feed or HTML</a> and
abort these steps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on board with the rest of this, but why rearrange the steps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As stated in the commit message, for clarity. If we never sniff these types it seems better to make that clear upfront.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more logical sense where it is; it's the first thing after the anomaly handing. If the no-sniff flag is set, for example, the steps will have already aborted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for me the confusing part is really the check-for-apache-bug flag as it's not clear what the supplied MIME type can and cannot be. It also seems weird to me to handle unknown MIME types before HTML and XML, but I could live with that I suppose.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GPHemsley does that make sense?

annevk added a commit to web-platform-tests/wpt that referenced this pull request Jul 15, 2024
@annevk annevk merged commit b47be44 into main Jul 15, 2024
2 checks passed
@annevk annevk deleted the annevk/html branch July 15, 2024 14:27
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 17, 2024
Automatic update from web-platform-tests
MIME Sniffing: HTML no feed

For whatwg/mimesniff#192.

--

wpt-commits: 48369a247abab60f100a84de8faef3cacf0b42c5
wpt-pr: 47002
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this pull request Jul 18, 2024
Automatic update from web-platform-tests
MIME Sniffing: HTML no feed

For whatwg/mimesniff#192.

--

wpt-commits: 48369a247abab60f100a84de8faef3cacf0b42c5
wpt-pr: 47002
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jul 18, 2024
Automatic update from web-platform-tests
MIME Sniffing: HTML no feed

For whatwg/mimesniff#192.

--

wpt-commits: 48369a247abab60f100a84de8faef3cacf0b42c5
wpt-pr: 47002
sadym-chromium pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Should we still sniff if Content-Type is text/html?
3 participants