Skip to content

Commit

Permalink
Revert "revert index.js"
Browse files Browse the repository at this point in the history
This reverts commit e007227.
  • Loading branch information
sahell0x committed Jan 30, 2025
1 parent e007227 commit fd14025
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const QueryResult = ({ item, collection, data, dataBuffer, width, disableRunEven
} else if (contentType.includes('video')) {
allowedPreviewModes.unshift({ mode: 'preview-video', name: 'Video', uid: uuid() });
}

return allowedPreviewModes;
}, [mode, data, formattedData]);

Expand Down
9 changes: 4 additions & 5 deletions packages/bruno-app/src/utils/common/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,7 @@ export const getCodeMirrorModeBasedOnContentType = (contentType, body) => {

if (contentType.includes('json')) {
return 'application/ld+json';
}else if (contentType.includes('image')) {
return 'application/image';
}
else if (contentType.includes('xml')) {
} else if (contentType.includes('xml')) {
return 'application/xml';
} else if (contentType.includes('html')) {
return 'application/html';
Expand All @@ -172,7 +169,9 @@ export const getCodeMirrorModeBasedOnContentType = (contentType, body) => {
return 'application/xml';
} else if (contentType.includes('yaml')) {
return 'application/yaml';
} else {
} else if (contentType.includes('image')) {
return 'application/image';
} else {
return 'application/text';
}
};
5 changes: 1 addition & 4 deletions packages/bruno-app/src/utils/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ export const getContentType = (headers) => {
return header[1];
});
if (contentType && contentType.length) {
if (typeof contentType[0] === 'string' && /^image\/svg\+xml/i.test(contentType[0])) {
return 'image/svg+xml';
}
else if (typeof contentType[0] == 'string' && /^[\w\-]+\/([\w\-]+\+)?json/.test(contentType[0])) {
if (typeof contentType[0] == 'string' && /^[\w\-]+\/([\w\-]+\+)?json/.test(contentType[0])) {
return 'application/ld+json';
} else if (typeof contentType[0] == 'string' && /^[\w\-]+\/([\w\-]+\+)?xml/.test(contentType[0])) {
return 'application/xml';
Expand Down

0 comments on commit fd14025

Please sign in to comment.