1
0
mirror of https://github.com/foss42/apidash.git synced 2025-07-06 00:42:57 +08:00

Fix svg contentType

This commit is contained in:
Ashita Prasad
2023-04-15 21:53:15 +05:30
parent c963591ad3
commit 51809abcf3
2 changed files with 4 additions and 0 deletions

@ -288,6 +288,7 @@ const Map<String, Map<String, List<ResponseBodyView>>>
const Map<String, String> kCodeHighlighterMap = {
kSubTypeHtml: "xml",
kSubTypeSvg: "xml",
kSubTypeYaml: "yaml",
kSubTypeYml: "yaml",
kSubTypeTextYaml: "yaml",

@ -94,6 +94,9 @@ MediaType? getMediaTypeFromHeaders(Map? headers) {
var subtype = mediaType.subtype;
//print(mediaType);
if(kResponseBodyViewOptions.containsKey(type)){
if (kResponseBodyViewOptions[type]!.containsKey(subtype)){
return (kResponseBodyViewOptions[type]![subtype]!, kCodeHighlighterMap[subtype] ?? subtype);
}
if(subtype.contains(kSubTypeJson)){
subtype = kSubTypeJson;
}