[skip ci] proxy content-type header from API response to Next.js proxy response

This commit is contained in:
tom
2024-10-18 18:16:53 +02:00
parent bc8fb795ce
commit 4cd65903e2
+1
View File
@@ -24,6 +24,7 @@ const handler = async(nextReq: NextApiRequest, nextRes: NextApiResponse) => {
// proxy some headers from API
nextRes.setHeader('x-request-id', apiRes.headers.get('x-request-id') || '');
nextRes.setHeader('set-cookie', apiRes.headers.get('set-cookie') || '');
nextRes.setHeader('content-type', apiRes.headers.get('content-type') || '');
nextRes.status(apiRes.status).send(apiRes.body);
};