handle 204 and 304 proxy responses

pull/100/head
Ben Phelps 2 years ago
parent 236450f6f1
commit bc2025b3ba

@ -19,6 +19,10 @@ export default async function credentialedProxyHandler(req, res) {
},
});
if (status === 204 || status === 304) {
return res.status(status).end();
}
if (contentType) res.setHeader("Content-Type", contentType);
return res.status(status).send(data);
}

@ -13,6 +13,11 @@ export default async function genericProxyHandler(req, res) {
const [status, contentType, data] = await httpProxy(url);
if (contentType) res.setHeader("Content-Type", contentType);
if (status === 204 || status === 304) {
return res.status(status).end();
}
return res.status(status).send(data);
}
}

Loading…
Cancel
Save