Skip to content

Commit 9285014

Browse files
Implement missing methods from response object to fix the middleware issue in next 14.4.12 or lower. (#454)
1 parent 3a0bc84 commit 9285014

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/open-next/src/http/openNextResponse.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,4 +306,23 @@ export class OpenNextNodeResponse extends Transform implements ServerResponse {
306306
}
307307
callback();
308308
}
309+
310+
get sent() {
311+
return this.finished || this.headersSent;
312+
}
313+
314+
getHeaderValues(name: string): string[] | undefined {
315+
const values = this.getHeader(name);
316+
317+
if (values === undefined) return undefined;
318+
319+
return (Array.isArray(values) ? values : [values]).map((value) =>
320+
value.toString(),
321+
);
322+
}
323+
324+
send() {
325+
const body = this.body;
326+
this.end(body);
327+
}
309328
}

0 commit comments

Comments
 (0)