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