Skip to content

Commit 6030a6b

Browse files
committed
perf(router): skip redundant request macro checks
1 parent 0928e1c commit 6030a6b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

storage/framework/core/router/src/stacks-router.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3616,7 +3616,6 @@ export function enhanceRequest(req: EnhancedRequest): EnhancedRequest {
36163616
const routeParams: Record<string, string> = req.params ?? {}
36173617

36183618
req.params = routeParams
3619-
applyRequestEnhancements(req as unknown as Request, routeParams)
36203619

36213620
/*
36223621
* Every request gets an id.
@@ -3638,6 +3637,8 @@ export function enhanceRequest(req: EnhancedRequest): EnhancedRequest {
36383637
if ((req as unknown as Record<symbol, unknown>)[STACKS_REQUEST_ENHANCED] === true)
36393638
return req
36403639

3640+
applyRequestEnhancements(req as unknown as Request, routeParams)
3641+
36413642
/*
36423643
* `query` comes from the router (bun-router 0.1.7), as a lazy accessor that
36433644
* parses on first access and caches - so a request that never reads it still

0 commit comments

Comments
 (0)