File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
library/sources/http-server Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -110,16 +110,15 @@ export function checkIfRequestIsBlocked(
110110 return true ;
111111 }
112112
113- const isUserAgentBlocked =
114- context . headers && typeof context . headers [ "user-agent" ] === "string"
115- ? agent . getConfig ( ) . isUserAgentBlocked ( context . headers [ "user-agent" ] )
116- : ( { blocked : false } as const ) ;
117-
118113 const userAgent =
119114 context . headers && typeof context . headers [ "user-agent" ] === "string"
120115 ? context . headers [ "user-agent" ]
121116 : undefined ;
122117
118+ const isUserAgentBlocked = userAgent
119+ ? agent . getConfig ( ) . isUserAgentBlocked ( userAgent )
120+ : ( { blocked : false } as const ) ;
121+
123122 if ( userAgent ) {
124123 const isMonitoredUserAgent = agent
125124 . getConfig ( )
You can’t perform that action at this time.
0 commit comments