We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0d23453 + 9a4c13b commit af4944dCopy full SHA for af4944d
lib/src/response/service/hal-response-service.js
@@ -12,7 +12,9 @@ export function getType({ headers } = {}) {
12
}
13
14
export function containsHalResource({ headers } = {}) {
15
- return (headers[CONTENT_TYPE].includes(HAL_JSON) || headers[CONTENT_TYPE].includes(HAL_JSON2))
16
- ? true
17
- : headers[CONTENT_LOCATION] && headers[LOCATION] && headers[CONTENT_LOCATION] === headers[LOCATION];
+ return headers && headers[CONTENT_TYPE] ?
+ (headers[CONTENT_TYPE].includes(HAL_JSON) || headers[CONTENT_TYPE].includes(HAL_JSON2)) ?
+ true
18
+ : headers[CONTENT_LOCATION] && headers[LOCATION] && headers[CONTENT_LOCATION] === headers[LOCATION]
19
+ : false;
20
0 commit comments