handle 204 and 304 proxy responses
This commit is contained in:
parent
236450f6f1
commit
bc2025b3ba
2 changed files with 9 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue