diff --git a/lib/src/response/service/hal-response-service.js b/lib/src/response/service/hal-response-service.js index 7a82669..6d50cbc 100644 --- a/lib/src/response/service/hal-response-service.js +++ b/lib/src/response/service/hal-response-service.js @@ -5,13 +5,14 @@ const LOCATION = "location"; // Media Types const HAL_JSON = "application/vnd.hal+json"; +const HAL_JSON2 = "application/hal+json"; export function getType({ headers } = {}) { return headers[CONTENT_TYPE] ? headers[CONTENT_TYPE] : null; } export function containsHalResource({ headers } = {}) { - return headers[CONTENT_TYPE].includes(HAL_JSON) + return (headers[CONTENT_TYPE].includes(HAL_JSON) || headers[CONTENT_TYPE].includes(HAL_JSON2)) ? true : headers[CONTENT_LOCATION] && headers[LOCATION] && headers[CONTENT_LOCATION] === headers[LOCATION]; }