Skip to content

Commit

Permalink
pass through headers on sdk responses
Browse files Browse the repository at this point in the history
  • Loading branch information
bkendall committed Jan 14, 2021
1 parent 933ef1b commit a2429ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hosting/initMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export function initMiddleware(init: TemplateServerResponse): RequestHandler {
if (sdkRes.status === 404) {
return next();
}
for (const [key, value] of Object.entries(sdkRes.response.headers.raw())) {
res.setHeader(key, value);
}
sdkRes.body.pipe(res);
})
.catch((e) => {
Expand Down

0 comments on commit a2429ae

Please sign in to comment.