Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 9d98b8a

Browse files
authored
fix(netlify): don't directly assign locals (#481)
1 parent e53c18d commit 9d98b8a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/great-ties-relate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/netlify': patch
3+
---
4+
5+
Fixes an error where edge middleware would incorrectly assign locals

packages/netlify/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export default function netlifyIntegration(
291291
request,
292292
params: {}
293293
});
294-
ctx.locals = { netlify: { context } }
294+
ctx.locals.netlify = { context }
295295
// https://docs.netlify.com/edge-functions/api/#return-a-rewrite
296296
ctx.rewrite = (target) => {
297297
if(target instanceof Request) {

0 commit comments

Comments
 (0)