Skip to content

Commit 803d8c5

Browse files
committed
Merge commit '9a883436fc282d5bc57de2b304048bd614fdbe53'
Make `test_sig` more robust
2 parents 022ee5e + 9a88343 commit 803d8c5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

rust/auth-impls/src/signature.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ mod tests {
140140
token = token
141141
.chars()
142142
.enumerate()
143-
.map(|(idx, c)| if idx == 33 * 2 + 10 || idx == 33 * 2 + 11 { '0' } else { c })
143+
.map(|(idx, c)| if (33 * 2 + 10..33 * 2 + 15).contains(&idx) { '0' } else { c })
144144
.collect();
145145
headers_map.insert("Authorization".to_string(), token);
146146
assert!(matches!(auth.verify(&headers_map).await.unwrap_err(), VssError::AuthError(_)));
@@ -150,7 +150,7 @@ mod tests {
150150
token = token
151151
.chars()
152152
.enumerate()
153-
.map(|(idx, c)| if idx == 10 || idx == 11 { '0' } else { c })
153+
.map(|(idx, c)| if (10..15).contains(&idx) { '0' } else { c })
154154
.collect();
155155
headers_map.insert("Authorization".to_string(), token);
156156
assert!(matches!(auth.verify(&headers_map).await.unwrap_err(), VssError::AuthError(_)));

0 commit comments

Comments
 (0)