diff --git a/examples/curl.rs b/examples/curl.rs index d0bbb43..4951568 100644 --- a/examples/curl.rs +++ b/examples/curl.rs @@ -111,7 +111,7 @@ http_request_handler!(curl_access_handler, |request: &mut http::Request| { match co.enable { true => { - if request.user_agent().as_bytes().starts_with(b"curl") { + if request.user_agent().is_some_and(|ua| ua.as_bytes().starts_with(b"curl")) { http::HTTPStatus::FORBIDDEN.into() } else { core::Status::NGX_DECLINED