-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
inspector: add mimeType and charset support to Network.Response #58192
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
base: main
Are you sure you want to change the base?
Conversation
common.mustCall(({ params }) => { | ||
assert.strictEqual(params.response.mimeType, ''); | ||
assert.strictEqual(params.response.charset, ''); | ||
}) |
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.
When the Content-Type header is not set, Chromium also assigns an empty string.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58192 +/- ##
==========================================
- Coverage 90.15% 90.12% -0.03%
==========================================
Files 630 629 -1
Lines 186756 186670 -86
Branches 36652 36635 -17
==========================================
- Hits 168361 168231 -130
- Misses 11192 11215 +23
- Partials 7203 7224 +21
🚀 New features to boost your workflow:
|
const contentType = contentTypeKeyIndex !== -1 ? response.headers[contentTypeKeyIndex + 1].toString() : ''; | ||
const mimeTypeObj = new MIMEType(contentType); | ||
mimeType = mimeTypeObj.essence || ''; | ||
charset = mimeTypeObj.params.get('charset'); |
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.
Charset can be undefined/null if this does not exist. I don't think we want that.
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.
I overlooked this case.
Like mimeType, I’ve set it to an empty string.
}) | ||
); | ||
}), | ||
2 |
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.
This seems indented out of order.
Refs: #53946
It supports the mimeType and charset defined in Network.Response.
https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-Response