File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,19 +43,28 @@ export class MatchEventsGateway {
4343 const authHeader = request . headers . authorization ;
4444
4545 if ( ! authHeader || ! authHeader . startsWith ( "Basic " ) ) {
46+ this . logger . warn ( "game server connection rejected: missing auth" , {
47+ ip : request . headers [ "cf-connecting-ip" ] ,
48+ } ) ;
4649 client . close ( ) ;
4750 return ;
4851 }
4952
5053 const base64Credentials = authHeader . split ( " " ) . at ( 1 ) ;
5154 if ( ! base64Credentials ) {
55+ this . logger . warn ( "game server connection rejected: malformed auth" , {
56+ ip : request . headers [ "cf-connecting-ip" ] ,
57+ } ) ;
5258 client . close ( ) ;
5359 return ;
5460 }
5561
5662 const decoded = Buffer . from ( base64Credentials , "base64" ) . toString ( ) ;
5763 const colonIndex = decoded . indexOf ( ":" ) ;
5864 if ( colonIndex === - 1 ) {
65+ this . logger . warn ( "game server connection rejected: invalid credentials format" , {
66+ ip : request . headers [ "cf-connecting-ip" ] ,
67+ } ) ;
5968 client . close ( ) ;
6069 return ;
6170 }
You can’t perform that action at this time.
0 commit comments