Fixes #3730
Add extra check for missing response content and contentType
This commit is contained in:
@@ -83,8 +83,12 @@ export default class ResponseBody extends React.Component {
|
|||||||
// Anything else (CORS)
|
// Anything else (CORS)
|
||||||
} else if (typeof content === "string") {
|
} else if (typeof content === "string") {
|
||||||
bodyEl = <HighlightCode value={ content } />
|
bodyEl = <HighlightCode value={ content } />
|
||||||
} else {
|
} else if ( content.size > 0 ) {
|
||||||
|
// We don't know the contentType, but there was some content returned
|
||||||
bodyEl = <div>Unknown response type</div>
|
bodyEl = <div>Unknown response type</div>
|
||||||
|
} else {
|
||||||
|
// We don't know the contentType and there was no content returned
|
||||||
|
bodyEl = null
|
||||||
}
|
}
|
||||||
|
|
||||||
return ( !bodyEl ? null : <div>
|
return ( !bodyEl ? null : <div>
|
||||||
|
|||||||
Reference in New Issue
Block a user