@mandujs/core 0.54.22 → 0.54.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1328,7 +1328,7 @@ async function handleRequestObserved(
1328
1328
  const result = await handleRequestInternal(req, router, registry);
1329
1329
 
1330
1330
  if (!result.ok) {
1331
- const errorResponse = errorToResponse(result.error, registry.settings.isDev);
1331
+ const errorResponse = errorToResponse(result.error, registry.settings.isDev, req);
1332
1332
  if (registry.settings.isDev) {
1333
1333
  // #177: dev 모드 에러 응답도 캐시 방지
1334
1334
  if (!errorResponse.headers.has("Cache-Control")) {
@@ -2394,14 +2394,14 @@ async function renderNotFoundPage(
2394
2394
  if (!registration) {
2395
2395
  const handler = registry.notFoundHandler;
2396
2396
  if (!handler) {
2397
- return errorToResponse(createNotFoundResponse(new URL(req.url).pathname), settings.isDev);
2397
+ return errorToResponse(createNotFoundResponse(new URL(req.url).pathname), settings.isDev, req);
2398
2398
  }
2399
2399
  try {
2400
2400
  const globalReg = await handler();
2401
2401
  registration = { component: globalReg.component as React.ComponentType<Record<string, unknown>>, filling: globalReg.filling };
2402
2402
  } catch (handlerError) {
2403
2403
  console.error(`[Mandu] global notFoundHandler failed; falling back to built-in 404:`, handlerError);
2404
- return errorToResponse(createNotFoundResponse(new URL(req.url).pathname), settings.isDev);
2404
+ return errorToResponse(createNotFoundResponse(new URL(req.url).pathname), settings.isDev, req);
2405
2405
  }
2406
2406
  }
2407
2407
 
@@ -2460,7 +2460,7 @@ async function renderNotFoundPage(
2460
2460
  return response;
2461
2461
  } catch (renderError) {
2462
2462
  console.error(`[Mandu] app/not-found.tsx render failed; falling back to built-in 404:`, renderError);
2463
- return errorToResponse(createNotFoundResponse(new URL(req.url).pathname), settings.isDev);
2463
+ return errorToResponse(createNotFoundResponse(new URL(req.url).pathname), settings.isDev, req);
2464
2464
  }
2465
2465
  }
2466
2466
 
@@ -3394,7 +3394,7 @@ async function handleRequestInternal(
3394
3394
  // Surface error-path responses to the chain so logging / metrics
3395
3395
  // layers see the final status. The outer `handleRequest` still owns
3396
3396
  // dev-mode Cache-Control stamping + observability lifecycle emission.
3397
- return errorToResponse(result.error, settings.isDev);
3397
+ return errorToResponse(result.error, settings.isDev, finalReq);
3398
3398
  },
3399
3399
  });
3400
3400
  if (middlewareResponse) {