Skip to content

Commit 955d2a5

Browse files
authored
Fix getHeader crash (#321)
1 parent 5acd30d commit 955d2a5

File tree

1 file changed

+2
-1
lines changed
  • packages/open-next/src/adapters/plugins/routing

1 file changed

+2
-1
lines changed

packages/open-next/src/adapters/plugins/routing/util.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export async function proxyRequest(
4747
proxyRes.on("end", function () {
4848
const newBody = Buffer.concat(body).toString();
4949
debug(`Proxying response`, {
50-
headers: proxyRes.getHeaders(),
50+
// @ts-ignore TODO: get correct type for the proxyRes
51+
headers: proxyRes.getHeaders?.() || proxyRes.headers,
5152
body: newBody,
5253
});
5354
res.end(newBody);

0 commit comments

Comments
 (0)