mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 20:55:41 +00:00
fix: prevent import failure for Postman collections with missing response headers (#6129)
This commit is contained in:
@@ -751,6 +751,11 @@ const searchLanguageByHeader = (headers) => {
|
||||
};
|
||||
|
||||
const getBodyTypeFromContentTypeHeader = (headers) => {
|
||||
// Check if headers is null, undefined, or not an array
|
||||
if (!headers || !Array.isArray(headers)) {
|
||||
return 'text';
|
||||
}
|
||||
|
||||
const contentTypeHeader = headers.find((header) => header.key.toLowerCase() === 'content-type');
|
||||
if (contentTypeHeader) {
|
||||
const contentType = contentTypeHeader.value?.toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user