diff --git a/examples/http_body.rs b/examples/http_body.rs index da1bda55..374a8751 100644 --- a/examples/http_body.rs +++ b/examples/http_body.rs @@ -60,7 +60,7 @@ impl HttpContext for HttpBody { // Since we returned "Pause" previuously, this will return the whole body. if let Some(body_bytes) = self.get_http_response_body(0, body_size) { let body_str = String::from_utf8(body_bytes).unwrap(); - if body_str.find("secret").is_some() { + if body_str.contains("secret") { let new_body = format!("Original message body ({} bytes) redacted.", body_size); self.set_http_response_body(0, body_size, &new_body.into_bytes()); }