Added check if content-type header is present for transformResponse
This commit is contained in:
parent
0b40e1c3fe
commit
05f573d181
1 changed files with 4 additions and 3 deletions
|
|
@ -15,9 +15,10 @@ const axiosWithoutProxy = async (req, _store) => {
|
|||
(data, headers) => {
|
||||
// If the response has a JSON content type, try parsing it
|
||||
if (
|
||||
headers["content-type"].startsWith("application/json") ||
|
||||
headers["content-type"].startsWith("application/vnd.api+json") ||
|
||||
headers["content-type"].startsWith("application/hal+json")
|
||||
headers["content-type"] &&
|
||||
(headers["content-type"].startsWith("application/json") ||
|
||||
headers["content-type"].startsWith("application/vnd.api+json") ||
|
||||
headers["content-type"].startsWith("application/hal+json"))
|
||||
) {
|
||||
try {
|
||||
const jsonData = JSON.parse(data)
|
||||
|
|
|
|||
Loading…
Reference in a new issue