Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b6ecd57d0 | |||
| b1421f7dd5 | |||
| 00e38c9e17 | |||
| 9e650e1f75 |
@@ -85,9 +85,8 @@ pub async fn validate_stream_token(proxy: &Proxy, provided: &str) -> std::result
|
||||
match token_guard.take() {
|
||||
Some(expected) if expected == provided => Ok(()),
|
||||
Some(_) => {
|
||||
// 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.
|
||||
// Put the token back since it wasn't matched
|
||||
// Actually no — the design is that any attempt consumes it for security
|
||||
Err("Invalid stream token".to_string())
|
||||
}
|
||||
None => Err("Stream token already used".to_string()),
|
||||
|
||||
Reference in New Issue
Block a user