File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,18 @@ export function applyConfigOverrides({
2626 return baseConfig ;
2727 }
2828
29- // Only apply overrides if allowRequestOverrides is enabled
30- if ( ! baseConfig . allowRequestOverrides ) {
31- throw new Error ( "Request overrides are not enabled" ) ;
32- }
33-
3429 const result : UserConfig = { ...baseConfig } ;
3530 const overridesFromHeaders = extractConfigOverrides ( "header" , request . headers ) ;
3631 const overridesFromQuery = extractConfigOverrides ( "query" , request . query ) ;
3732
33+ // Only apply overrides if allowRequestOverrides is enabled
34+ if (
35+ ! baseConfig . allowRequestOverrides &&
36+ ( Object . keys ( overridesFromHeaders ) . length > 0 || Object . keys ( overridesFromQuery ) . length > 0 )
37+ ) {
38+ throw new Error ( "Request overrides are not enabled" ) ;
39+ }
40+
3841 // Apply header overrides first
3942 for ( const [ key , overrideValue ] of Object . entries ( overridesFromHeaders ) ) {
4043 assertValidConfigKey ( key ) ;
You can’t perform that action at this time.
0 commit comments