chore: wire Carplace into dev and production stacks
Build & Deploy / Build & Push Docker Image (push) Successful in 2m55s
Test / Type Check (all packages) (push) Successful in 54s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Failing after 48s
Test / Homepage Unit Tests (push) Successful in 43s
Test / Storefront Unit Tests (push) Failing after 40s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Failing after 42s
Test / API Integration Tests (push) Successful in 1m0s

This commit is contained in:
root
2026-07-02 18:15:42 -04:00
parent ad5f5ebab7
commit 7ff2dbb139
214 changed files with 5258 additions and 5906 deletions
+1 -11
View File
@@ -20,7 +20,7 @@ import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';
const dashboardLanguageCookie = 'rentaldrivego-language';
const reservedProxySegments = new Set(['dashboard', 'admin', 'storefront']);
const reservedProxySegments = new Set(['dashboard', 'admin', 'carplace']);
function applySecurityHeaders(response: NextResponse, contentSecurityPolicy: string): NextResponse {
response.headers.set('Content-Security-Policy', contentSecurityPolicy);
@@ -99,16 +99,6 @@ export function proxy(request: NextRequest): NextResponse {
}
const pathSegments = request.nextUrl.pathname.split('/').filter(Boolean);
if (isLocale(pathSegments[0]) && pathSegments[1] === 'storefront') {
const destination = request.nextUrl.clone();
destination.pathname = `/${pathSegments.slice(1).join('/')}`;
return applySecurityHeaders(NextResponse.redirect(destination), csp);
}
if (isLocale(pathSegments[0]) && isMode(pathSegments[1]) && pathSegments[2] === 'storefront') {
const destination = request.nextUrl.clone();
destination.pathname = `/${pathSegments.slice(2).join('/')}`;
return applySecurityHeaders(NextResponse.redirect(destination), csp);
}
// Redirect locale-less paths (e.g. /sign-in → /en/system/sign-in), but not proxied app paths or files.
const firstSegment = request.nextUrl.pathname.split('/')[1];