Skip to content

Commit e6d23d6

Browse files
update
1 parent d8b8b8f commit e6d23d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/common/contentType.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export function parseContentType(contentTypeValue: string | undefined): ContentT
1010
if (!contentTypeValue) {
1111
return undefined;
1212
}
13-
const [mediaType, ...args] = contentTypeValue.split(";").map((s) => s.trim());
13+
const [mediaType, ...args] = contentTypeValue.split(";").map((s) => s.trim().toLowerCase());
1414
const parameters: Record<string, string> = {};
1515

1616
for (const param of args) {
17-
const [key, value] = param.split("=").map((s) => s.trim());
17+
const [key, value] = param.split("=").map((s) => s.trim().toLowerCase());
1818
if (key && value) {
1919
parameters[key] = value;
2020
}
@@ -26,7 +26,7 @@ export function parseContentType(contentTypeValue: string | undefined): ContentT
2626
// Determine whether a content type string is a valid JSON content type.
2727
// https://docs.microsoft.com/en-us/azure/azure-app-configuration/howto-leverage-json-content-type
2828
export function isJsonContentType(contentType: ContentType | undefined): boolean {
29-
const mediaType = contentType?.mediaType?.trim().toLowerCase();
29+
const mediaType = contentType?.mediaType;
3030
if (!mediaType) {
3131
return false;
3232
}

0 commit comments

Comments
 (0)