commit | 7944ca17fb6416e7df83a5de8ec75559c79ca8cc | [log] [tgz] |
---|---|---|
author | Mike Jackson <mjackson@microsoft.com> | Thu Mar 21 17:03:42 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Mar 21 17:03:42 2019 |
tree | d2aff5f46c6e5a43931faa4a941b76e808572c28 | |
parent | 30207c4a9a76ce6d601dee8a25e25b83f95dd8fb [diff] |
DevTools: Network - Request response doesn't render contents with no mimeType If a network request is blocked or cancelled, the mimeType field remains 'undefined' because the 'responseReceived' event is never raised. If a user then clicks on this blocked/cancelled network request in the network tool, any attempt to view the Response will result in a white window, instead of 'Failed to load response data'. This occurs because the RequestResponseView assumes that a mimeType is present, and consequently throws a JS exception: Cannot read property 'startsWith' of undefined shell.js:720:43 Function.fromMimeType network_module.js:785:114 Function._hasTextContent network_module.js:792:97 Function.sourceViewForRequest network_module.js:798:91 async Network.RequestResponseView.createPreview network_module.js:797:40 async Network.RequestResponseView.showPreview The fix here is to update _hasTextContent, so that the call into fromMimeType always has a valid string. I've also updated the JSDoc comment to indicate that a string is required and not nullable. Change-Id: Ib6e89ef6f7cc45387cb25a7c10e01432f8855199 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1533052 Auto-Submit: Mike Jackson <mjackson@microsoft.com> Reviewed-by: Joel Einbinder <einbinder@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Commit-Queue: Mike Jackson <mjackson@microsoft.com> Commit-Queue: Dmitry Gozman <dgozman@chromium.org> Cr-Commit-Position: refs/heads/master@{#642980}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .