Walkthrough preflight rejects timeout_secs values outside 1..=600 (#390)

The walkthrough check refuses timeout_secs outside 1..=600, as the recorder does. Fixes #288.
This commit is contained in:
phatloi0010
2026-11-02 23:11:25 +07:00
committed by GitHub
parent 735a96db2f
commit 4bb8f76158
2 changed files with 5 additions and 0 deletions
@@ -243,6 +243,9 @@ impl WalkthroughParams {
if self.keep_bodies.any() && !self.capture_network {
return Err(ToolError::invalid("keep_bodies needs capture_network"));
}
if !(1..=600).contains(&self.timeout_secs) {
return Err(ToolError::invalid("timeout_secs must be 1..=600"));
}
Ok(())
}
}
@@ -684,6 +684,8 @@ fn the_checker_agrees_with_what_the_recorder_refuses() {
json!({"actions": [ok_goto], "capture": {"events": ["no_such_family"]}}),
json!({"actions": [ok_goto], "keep_bodies": {"request_body": true}, "capture_network": false}),
json!({"actions": [ok_goto], "storage": {"cookies": [{"url": "ftp://x", "name": "a", "value": "b"}]}}),
json!({"actions": [ok_goto], "timeout_secs": 0}),
json!({"actions": [ok_goto], "timeout_secs": 601}),
// Refused at the step, after those before it ran.
json!({"actions": [{"kind": "goto", "url": "example.com"}]}),
json!({"actions": [ok_goto, {"kind": "click"}]}),