Skip to content

Commit

Permalink
[skip ci] proxy content-type header from API response to Next.js prox…
Browse files Browse the repository at this point in the history
…y response
  • Loading branch information
tom2drum committed Oct 18, 2024
1 parent dc83feb commit 2ed8133
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pages/api/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit 2ed8133

Please sign in to comment.