Closed quoininc-huudatran closed 2 years ago
Hi @quoininc-huudatran, atm _isJSON()
returns true only when Content-Type: application/json
But even if is-type
library would be used - it will be still false
because
typeIs.is('application/hal+json', 'json') === false
You can try it here https://runkit.com/embed/15jv0a7atjye
According to documentation of type-is:
A suffix such as +json. This can be combined with a wildcard such as
*/vnd+json
orapplication/*+json
. The full mime type will be returned if matched.
So we can do:
Boolean(typeIs.is('application/hal+json', ['json', 'application/*+json']))
You are right, please review the fix #243
Stale issue message
When setting
Content-Type: application/hal+json
, the response returnsfalse
forres_isJSON()
call.I would expect it to return
true
.