Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a0c97dd9e | |||
| 917acfdb27 | |||
| 0fd90e8935 |
@@ -85,8 +85,9 @@ pub async fn validate_stream_token(proxy: &Proxy, provided: &str) -> std::result
|
||||
match token_guard.take() {
|
||||
Some(expected) if expected == provided => Ok(()),
|
||||
Some(_) => {
|
||||
// Put the token back since it wasn't matched
|
||||
// Actually no — the design is that any attempt consumes it for security
|
||||
// Wrong token: still consumed by the `take()` above. Any validation
|
||||
// attempt — correct or not — invalidates the token, so a wrong
|
||||
// guess cannot be followed by a correct one.
|
||||
Err("Invalid stream token".to_string())
|
||||
}
|
||||
None => Err("Stream token already used".to_string()),
|
||||
|
||||
Reference in New Issue
Block a user