-
Notifications
You must be signed in to change notification settings - Fork 323
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
Introduce get the MIME type
for request and response
#1657
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty close now!
I've tried to address those review comments and rewrap the switch cases for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, only nits remain. \o/
You don't have to squash as I'll do that through the GitHub UI. If you could work out a tentative commit message that would help though.
And perhaps we should no longer mark this as Editorial as you've fixed a null-pointer dereference.
Finally, I suspect you're not in the Acknowledgments section yet. Feel free to add yourself! |
Previously, the spec didn't clarify how to get the MIME type for both request and response. Thus, this patch will introduce the "get the MIME type" algorithm to clarify how to get it; then, other places which requires MIME type can reuse this algorithm. Also, with moving to use the algorithm, it will fix a potential null-pointer dereference issue in the `formData()` method because a request or a response's MIME type could potentially be null.
I've tried to reword the commit message and add more description in it. If it looks good, I can rename the PR title as well 🙏 |
Thanks @CYBAI for tackling this! I noticed a few more things at the end that I cleaned up before merging. Hope that's okay. |
Sure! Thank you so much for the cleanup! I just learned more about how to write the spec :) |
get the MIME type
for request and response
Fix #1630
When the
Request
orResponse
has aBlob
body withtype
and MIME type exists in its headers, browsers should always return the MIME type in headers instead of the body's type.However, previously, the spec didn't mention this clearly so this PR will help to clarify by introducing an algorithm of
get the MIME type
.Preview | Diff