chore: stabilize pipeline and harden infrastructure
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 9s
Build & Deploy / 🧪 QA (push) Failing after 1m43s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 3s

- Harden E2E smoke tests with increased timeouts and German keyword detection
- Implement defensive body parsing in analytics relay to prevent crashes
- Refine middleware to bypass i18n logic for Server Actions
- Fix date formatting consistency and JsonLd validation
This commit is contained in:
2026-04-12 22:38:59 +02:00
parent 0091b56dd1
commit 64ec24f8b2
9 changed files with 167 additions and 54 deletions

View File

@@ -14,8 +14,12 @@ export default async function middleware(request: NextRequest) {
const { method, url, headers } = request;
const { pathname } = request.nextUrl;
// Explicit bypass for infrastructure and Payload CMS routes to avoid locale redirects/interception
// Explicit bypass for infrastructure, Payload CMS, and Server Actions
// Next-Action header is present for all Next.js Server Actions
const isServerAction = headers.has('next-action');
if (
isServerAction ||
pathname.startsWith('/admin') ||
pathname.startsWith('/api') ||
pathname.startsWith('/stats') ||
@@ -55,10 +59,12 @@ export default async function middleware(request: NextRequest) {
// Only create a new request for GET/HEAD to avoid consuming the body stream on POST/PUT
// This resolves the "failed to pipe response" error (160k occurrences in GlitchTip)
if (['GET', 'HEAD'].includes(request.method)) {
// Clone headers to ensure all Next.js internal headers (like router state) are preserved
const clonedHeaders = new Headers(request.headers);
effectiveRequest = new NextRequest(urlObj, {
headers: request.headers,
headers: clonedHeaders,
method: request.method,
// No body for GET/HEAD
});
if (process.env.NODE_ENV !== 'production' || !process.env.CI) {