Skip to content

Commit

Permalink
fix(edge-runtime): remove unstable headers from user code (vercel#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz authored and jridgewell committed Jun 23, 2023
1 parent 399f6b0 commit 494b3a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/runtime/src/edge-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ function getDispatchFetchCode() {
}
response.waitUntil = () => Promise.all(event.awaiting);
response.headers.delete('content-encoding');
response.headers.delete('transform-encoding');
response.headers.delete('content-length');
return response;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/server/create-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function createHandler<T extends EdgeContext>(options: Options<T>) {
for (const [key, value] of Object.entries(
toNodeHeaders(response.headers)
)) {
if (key !== 'content-encoding' && value !== undefined) {
if (value !== undefined) {
res.setHeader(key, value)
}
}
Expand Down

0 comments on commit 494b3a7

Please sign in to comment.