Merge pull request #895 from AndrewBastin/bugfix/894

This commit is contained in:
Liyas Thomas
2020-05-24 19:04:04 +05:30
committed by GitHub

View File

@@ -15,9 +15,10 @@ const axiosWithoutProxy = async (req, _store) => {
(data, headers) => { (data, headers) => {
// If the response has a JSON content type, try parsing it // If the response has a JSON content type, try parsing it
if ( if (
headers["content-type"].startsWith("application/json") || headers["content-type"] &&
headers["content-type"].startsWith("application/vnd.api+json") || (headers["content-type"].startsWith("application/json") ||
headers["content-type"].startsWith("application/hal+json") headers["content-type"].startsWith("application/vnd.api+json") ||
headers["content-type"].startsWith("application/hal+json"))
) { ) {
try { try {
const jsonData = JSON.parse(data) const jsonData = JSON.parse(data)