mirror of
https://github.com/morten-olsen/react-native-debug-console.git
synced 2026-02-08 00:36:26 +01:00
Fix for responses without content type
This commit is contained in:
@@ -46,7 +46,7 @@ const getResponse = (request) => {
|
||||
if (request.responseType == 'blob' || request.responseType == 'ArrayBuffer') {
|
||||
return <Emphasis>🤖 Binary</Emphasis>
|
||||
}
|
||||
const contentType = request.getResponseHeader('content-type');
|
||||
const contentType = request.getResponseHeader('content-type') || '';
|
||||
const contentTypes = contentType.split(';').map(c => c.trim());
|
||||
|
||||
if (contentTypes.includes('application/json')) {
|
||||
@@ -106,7 +106,7 @@ const getPreview = (request, url) => {
|
||||
if (request.responseType == 'blob' || request.responseType == 'ArrayBuffer') {
|
||||
return [];
|
||||
}
|
||||
const contentType = request.getResponseHeader('content-type');
|
||||
const contentType = request.getResponseHeader('content-type') || '';
|
||||
const contentTypes = contentType.split(';').map(c => c.trim());
|
||||
|
||||
if (contentTypes.includes('text/html')) {
|
||||
|
||||
Reference in New Issue
Block a user