Added support for full content-type headers in isJSONContentType
This commit is contained in:
@@ -9,9 +9,19 @@ export const knownContentTypes = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export function isJSONContentType(contentType) {
|
export function isJSONContentType(contentType) {
|
||||||
return (
|
if (contentType.includes(";")) {
|
||||||
contentType === "application/json" ||
|
const [justContentType] = contentType.split(";")
|
||||||
contentType === "application/vnd.api+json" ||
|
|
||||||
contentType === "application/hal+json"
|
return (
|
||||||
)
|
justContentType === "application/json" ||
|
||||||
|
justContentType === "application/vnd.api+json" ||
|
||||||
|
justContentType === "application/hal+json"
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
contentType === "application/json" ||
|
||||||
|
contentType === "application/vnd.api+json" ||
|
||||||
|
contentType === "application/hal+json"
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user