isJSONContentType returns false for null/undefined

This commit is contained in:
Andrew Bastin
2020-08-18 14:13:20 -04:00
parent 9fe10fd9a2
commit f2b977c941

View File

@@ -9,7 +9,7 @@ export const knownContentTypes = [
] ]
export function isJSONContentType(contentType) { export function isJSONContentType(contentType) {
if (contentType.includes(";")) { if (contentType && contentType.includes(";")) {
const [justContentType] = contentType.split(";") const [justContentType] = contentType.split(";")
return ( return (