Skip to content

Commit e7e76ad

Browse files
committed
Allow for beautification of custom json header
Allow requests which contain custom application header for json to be parsed and displayed in a nice format This assist for cases for example, FHIR data "application/fhir+json".
1 parent b403f98 commit e7e76ad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/scripts/utils/utils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export function beautifyIndent (type, content) {
6060
if (/.*application\/\w+\+xml.*/.test(type)) {
6161
return { lang: 'xml', content: pd.xml(content, 2) }
6262
}
63+
64+
// application/{word characters}+json.
65+
if (/application\/\w+\+json/.test(type)) {
66+
return { lang: 'json', content: pd.json(content, 2) }
67+
}
6368
} catch (err) {
6469
console.log(err)
6570
return { lang: '', content }

0 commit comments

Comments
 (0)