Skip to content

Commit

Permalink
Merge bddd7fa into d1643b8
Browse files Browse the repository at this point in the history
  • Loading branch information
Ana Margarida Silva committed Sep 24, 2020
2 parents d1643b8 + bddd7fa commit 66599e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/api/api.js
Expand Up @@ -143,7 +143,10 @@ export class API extends Observable {

async _handleResponse(response, errorMessage = "Problem in request") {
let result = null;
if (response.headers.get("content-type").toLowerCase().startsWith("application/json")) {
if (
response.headers.get("content-type") &&
response.headers.get("content-type").toLowerCase().startsWith("application/json")
) {
result = await response.json();
} else {
result = await response.blob();
Expand Down

0 comments on commit 66599e3

Please sign in to comment.