@@ -39,29 +39,27 @@ fn obfuscate_redis_cmd<'a>(str: &mut String, cmd: &'a str, mut args: Vec<&'a str
3939 let mut uppercase_cmd = [ 0 ; 32 ] ; // no redis cmd is longer than 32 chars
4040 let uppercase_cmd = ascii_uppercase ( cmd, & mut uppercase_cmd) . unwrap_or ( & [ ] ) ;
4141 match uppercase_cmd {
42- b"AUTH" | b"MIGRATE" | b"HELLO" => {
42+ b"AUTH" | b"MIGRATE" | b"HELLO"
4343 // Obfuscate everything after command:
4444 // • AUTH password
4545 // • MIGRATE host port key|"" destination-db timeout [COPY] [REPLACE] [AUTH password]
4646 // [AUTH2 username password] [KEYS key [key ...]]
4747 // • HELLO [protover [AUTH username password] [SETNAME clientname]]
48- if !args. is_empty ( ) {
48+ if !args. is_empty ( ) => {
4949 args. clear ( ) ;
5050 args. push ( "?" ) ;
5151 }
52- }
53- b"ACL" => {
52+ b"ACL"
5453 // Obfuscate all arguments after the subcommand:
5554 // • ACL SETUSER username on >password ~keys &channels +commands
5655 // • ACL GETUSER username
5756 // • ACL DELUSER username [username ...]
5857 // • ACL LIST
5958 // • ACL WHOAMI
60- if args. len ( ) > 1 {
59+ if args. len ( ) > 1 => {
6160 args[ 1 ] = "?" ;
6261 args. drain ( 2 ..) ;
6362 }
64- }
6563 b"APPEND" | b"GETSET" | b"LPUSHX" | b"GEORADIUSBYMEMBER" | b"RPUSHX" | b"SET"
6664 | b"SETNX" | b"SISMEMBER" | b"ZRANK" | b"ZREVRANK" | b"ZSCORE" => {
6765 // Obfuscate 2nd argument:
@@ -100,7 +98,7 @@ fn obfuscate_redis_cmd<'a>(str: &mut String, cmd: &'a str, mut args: Vec<&'a str
10098 // • LINSERT key BEFORE|AFTER pivot value
10199 args = obfuscate_redis_args_n ( args, 3 ) ;
102100 }
103- b"GEOHASH" | b"GEOPOS" | b"GEODIST" | b"LPUSH" | b"RPUSH" | b"SREM" | b"ZREM" | b"SADD" => {
101+ b"GEOHASH" | b"GEOPOS" | b"GEODIST" | b"LPUSH" | b"RPUSH" | b"SREM" | b"ZREM" | b"SADD"
104102 // Obfuscate all arguments after the first one.
105103 // • GEOHASH key member [member ...]
106104 // • GEOPOS key member [member ...]
@@ -110,11 +108,10 @@ fn obfuscate_redis_cmd<'a>(str: &mut String, cmd: &'a str, mut args: Vec<&'a str
110108 // • SREM key member [member ...]
111109 // • ZREM key member [member ...]
112110 // • SADD key member [member ...]
113- if args. len ( ) > 1 {
111+ if args. len ( ) > 1 => {
114112 args[ 1 ] = "?" ;
115113 args. drain ( 2 ..) ;
116114 }
117- }
118115 b"GEOADD" => {
119116 // Obfuscating every 3rd argument starting from first
120117 // • GEOADD key longitude latitude member [longitude latitude member ...]
0 commit comments