File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed
Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,6 @@ module.exports = (config = {}) => {
4040
4141 const routers = { }
4242
43- /**
44- * Pre-create frozen empty objects for better performance and safety.
45- * Use Object.create(null) for prototype pollution protection.
46- * Frozen objects prevent accidental mutation that could cause cross-request state pollution.
47- * These are reused across requests when no query params or route params are present.
48- */
49- const EMPTY_PARAMS = Object . freeze ( Object . create ( null ) )
50-
5143 /**
5244 * Initialize LRU cache for route matching results with optimized settings.
5345 * Cache keys are method+path combinations to speed up repeated lookups.
@@ -161,7 +153,7 @@ module.exports = (config = {}) => {
161153 // Optimized parameter assignment with minimal overhead
162154 if ( ! req . params ) {
163155 // Use pre-created empty object or provided params directly
164- req . params = params || EMPTY_PARAMS
156+ req . params = params || Object . create ( null )
165157 } else if ( params ) {
166158 // Manual property copying - optimized for small objects
167159 // Pre-compute keys and length to avoid repeated calls
You can’t perform that action at this time.
0 commit comments