Skip to content

Commit

Permalink
Merge branch 'next' into astro-dot-session
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Nov 22, 2024
2 parents 91c1eae + a081175 commit a9ec98f
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 99 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-kids-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes a regression where Astro was trying to access `Request.headers`
2 changes: 2 additions & 0 deletions .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ jobs:
id: publish
run: |
GITHUB_ACTIONS=0 pnpm run build > build.output.txt 2>&1
# Snapshots don't work in pre mode. See https://github.com/changesets/changesets/issues/1195
pnpm exec changeset pre exit || true
pnpm exec changeset publish --tag experimental--${{ steps.getSnapshotName.outputs.result }} > publish.output.txt 2>&1
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@astrojs/check": "^0.9.4",
"@biomejs/biome": "1.9.3",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.9",
"@changesets/cli": "^2.27.10",
"@types/node": "^18.17.8",
"esbuild": "^0.21.5",
"eslint": "^9.14.0",
Expand Down
7 changes: 4 additions & 3 deletions packages/astro/src/core/middleware/noop-middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { MiddlewareHandler } from '../../types/public/common.js';
import { NOOP_MIDDLEWARE_HEADER } from '../constants.js';

export const NOOP_MIDDLEWARE_FN: MiddlewareHandler = (ctx, next) => {
ctx.request.headers.set(NOOP_MIDDLEWARE_HEADER, 'true');
return next();
export const NOOP_MIDDLEWARE_FN: MiddlewareHandler = async (_ctx, next) => {
const response = await next();
response.headers.set(NOOP_MIDDLEWARE_HEADER, 'true');
return response;
};
Loading

0 comments on commit a9ec98f

Please sign in to comment.