mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-03 04:29:09 +01:00
update: comment
This commit is contained in:
parent
b6b4b7362f
commit
767db75730
@ -366,12 +366,10 @@ const parseDataFromResponse = (response, disableParsingResponseJson = false) =>
|
||||
// Filter out ZWNBSP character
|
||||
// https://gist.github.com/antic183/619f42b559b78028d1fe9e7ae8a1352d
|
||||
|
||||
// a quoated string is also a vaild json but we want to show it as a quoated string only (parsing removes the quoates)
|
||||
// If the response is a string and starts and ends with double quotes, it's a stringified JSON and should not be parsed
|
||||
data = data.replace(/^\uFEFF/, '');
|
||||
if ( !disableParsingResponseJson && ! (typeof data === 'string' && data.startsWith("\"") && data.endsWith("\""))) {
|
||||
data = JSON.parse(data);
|
||||
} {
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
} catch {
|
||||
console.log('Failed to parse response data as JSON');
|
||||
|
Loading…
Reference in New Issue
Block a user