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

test(wpt): add mimesniff tests #16225

Merged
merged 6 commits into from
Oct 24, 2022
Merged

Conversation

marcosc90
Copy link
Contributor

@lucacasonato
Copy link
Member

Have you managed to narrow down what the cause of the remaining failures is?

@marcosc90
Copy link
Contributor Author

Have you managed to narrow down what the cause of the remaining failures is?

It looks like most of the errors are due to missing escaping of special characters. Chrome & Safari have ~700/1911, we're doing pretty good in comparison. I'll start working to get it to 1911 or close to it, in a follow up.

@marcosc90
Copy link
Contributor Author

marcosc90 commented Oct 10, 2022

After further investigation, it seems that there's a bug in WPT, it expects a TypeError to be thrown for the following value:

\n/x
assert_throws_js(TypeError, () => new Request("about:blank", { headers: [["Content-Type", val.input]] }));

While \n is not a valid value for a header, the specification states that the header value must be normalized, so AFAIK we're doing the right thing by not throwing in that scenario.

To normalize a byte sequence potentialValue, remove any leading and trailing HTTP whitespace bytes from potentialValue.

@marcosc90
Copy link
Contributor Author

marcosc90 commented Oct 10, 2022

Submitted a PR web-platform-tests/wpt#36359

Update: bug confirmed

@marcosc90
Copy link
Contributor Author

Have you managed to narrow down what the cause of the remaining failures is?

@lucacasonato The remaining failures are caused by FileAPI spec being broken and incompatible with MIME sniffing spec
See: w3c/FileAPI#43

I'm working in #16233 towards following MIME sniffing spec for Blob.type instead of FileAPI spec in case we want to follow that path, which I think is the best path forward (We can discuss it in that PR)

@bartlomieju bartlomieju added this to the 1.27 milestone Oct 22, 2022
@bartlomieju bartlomieju merged commit 5828ce7 into denoland:main Oct 24, 2022
@marcosc90 marcosc90 deleted the mimesniff-wpt branch October 24, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants