Add stop url test
This commit is contained in:
parent
5da486d43d
commit
bfcf131b33
1 changed files with 14 additions and 0 deletions
14
src/stop.rs
14
src/stop.rs
|
@ -30,3 +30,17 @@ pub async fn send_stop(secret: &ClientSecret) {
|
|||
Err(e) => warn!("Got error while sending stop message: {}", e),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod stop {
|
||||
use super::CONTROL_CENTER_STOP_URL;
|
||||
|
||||
#[test]
|
||||
fn stop_url_does_not_have_ping_in_url() {
|
||||
// This looks like a dumb test, yes, but it ensures that clients don't
|
||||
// get marked compromised because apparently just sending a json obj
|
||||
// with just the secret is acceptable to the ping endpoint, which messes
|
||||
// up non-trivial client configs.
|
||||
assert!(!CONTROL_CENTER_STOP_URL.contains("ping"))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue