Bug 199861

Summary: Web Inspector: application/xml content not shown
Product: WebKit Reporter: Olivier Blin <olivier.blin>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, joepeck, loic.yhuel, mcatanzaro, webkit-bug-importer, zan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Olivier Blin
Reported 2019-07-17 08:18:29 PDT
application/xml content from XHR requests is not shown in the inspector. In the network request preview tab, this error message is displayed instead: "An error occurred trying to load the resource." application/xml content should be treated as text, since application/xml is the standard mimetype for XML content. Apache serves XML content with the application/xml mimetype by default.
Attachments
Patch (4.50 KB, patch)
2019-07-17 08:26 PDT, Olivier Blin
no flags
Patch (4.81 KB, patch)
2019-07-17 12:31 PDT, Olivier Blin
no flags
Olivier Blin
Comment 1 2019-07-17 08:26:29 PDT
Devin Rousso
Comment 2 2019-07-17 09:04:27 PDT
Comment on attachment 374294 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374294&action=review r=me, nice catch! If need someone else to cq+ (or r+ again), just let me know. > Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js:290 > + "application/xml": "xml", We already have a mapping above for "text/xml" (>173), so please move just this line to be after that. > Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js:325 > + if (extension === "js" || extension === "json" || extension === "xml") This shouldn't be added to this `if`, as it doesn't apply to the comment. If anything, I'd restructure a bit of this function: ```js let extension = WI.fileExtensionForMIMEType(mimeType); if (extension === "xml") return true; // Various script/JSON mime types. if (extension === "js" || extension === "json") return true; // Various media text mime types. if (extension === "m3u8" || extension === "m3u") return true; ```
Olivier Blin
Comment 3 2019-07-17 12:31:34 PDT
Olivier Blin
Comment 4 2019-07-17 12:34:50 PDT
Comment on attachment 374294 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374294&action=review >> Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js:290 >> + "application/xml": "xml", > > We already have a mapping above for "text/xml" (>173), so please move just this line to be after that. Ok, even if content with application/xml mimetype does not really belong to the "Document" group. >> Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js:325 >> + if (extension === "js" || extension === "json" || extension === "xml") > > This shouldn't be added to this `if`, as it doesn't apply to the comment. If anything, I'd restructure a bit of this function: > ```js > let extension = WI.fileExtensionForMIMEType(mimeType); > if (extension === "xml") > return true; > > // Various script/JSON mime types. > if (extension === "js" || extension === "json") > return true; > > // Various media text mime types. > if (extension === "m3u8" || extension === "m3u") > return true; > ``` Done Thanks for the review!
Devin Rousso
Comment 5 2019-07-17 12:50:26 PDT
Comment on attachment 374316 [details] Patch r=me, thanks :)
WebKit Commit Bot
Comment 6 2019-07-17 13:39:34 PDT
Comment on attachment 374316 [details] Patch Clearing flags on attachment: 374316 Committed r247533: <https://trac.webkit.org/changeset/247533>
WebKit Commit Bot
Comment 7 2019-07-17 13:39:36 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2019-07-17 13:40:22 PDT
Note You need to log in before you can comment on or make changes to this bug.