Refactor content type based code to separate file
This commit is contained in:
17
functions/utils/contenttypes.js
Normal file
17
functions/utils/contenttypes.js
Normal file
@@ -0,0 +1,17 @@
|
||||
export const knownContentTypes = [
|
||||
"application/json",
|
||||
"application/vnd.api+json",
|
||||
"application/hal+json",
|
||||
"application/xml",
|
||||
"application/x-www-form-urlencoded",
|
||||
"text/html",
|
||||
"text/plain",
|
||||
]
|
||||
|
||||
export function isJSONContentType(contentType) {
|
||||
return (
|
||||
contentType === "application/json" ||
|
||||
contentType === "application/vnd.api+json" ||
|
||||
contentType === "application/hal+json"
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user