Skip to content

Commit

Permalink
fix(edge-runtime): remove unstable headers from user code (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz authored Aug 16, 2022
1 parent 81ab459 commit 1fa8e94
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

1 comment on commit 1fa8e94

@vercel
Copy link

@vercel vercel bot commented on 1fa8e94 Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

edge-runtime – ./

edge-runtime.vercel.sh
edge-runtime.vercel.app
edge-runtime-git-main.vercel.sh

Please sign in to comment.