Skip to content

Commit

Permalink
TEST: http block all
Browse files Browse the repository at this point in the history
  • Loading branch information
slivingston committed Oct 24, 2024
1 parent cd183dd commit 99dcf62
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/bin/rrhttp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,20 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
})
}

#[cfg(test)]
mod tests {
use super::{Config, ConfigMode, HttpVerb, Request};

#[test]
fn test_blockall() {
let mut config = Config::new();
config.default = ConfigMode::Block;
let mut req = Request {
verb: HttpVerb::Get,
uri: "/".into(),
body: None,
};
assert!(!config.is_valid(&req));
}
}

0 comments on commit 99dcf62

Please sign in to comment.