Skip to content

Commit

Permalink
check that content type exists before setting it
Browse files Browse the repository at this point in the history
  • Loading branch information
benphelps committed Sep 5, 2022
1 parent bad436b commit 08afa0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/proxies/credentialed.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default async function credentialedProxyHandler(req, res) {
},
});

res.setHeader("Content-Type", contentType);
if (contentType) res.setHeader("Content-Type", contentType);
return res.status(status).send(data);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/proxies/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function genericProxyHandler(req, res) {
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
const [status, contentType, data] = await httpProxy(url);

res.setHeader("Content-Type", contentType);
if (contentType) res.setHeader("Content-Type", contentType);
return res.status(status).send(data);
}
}
Expand Down

0 comments on commit 08afa0b

Please sign in to comment.