diff --git a/actix-http/src/response.rs b/actix-http/src/response.rs index 8bd30d417..7f73538fc 100644 --- a/actix-http/src/response.rs +++ b/actix-http/src/response.rs @@ -57,7 +57,7 @@ impl Response { /// Creates a new response with status 400 Bad Request. #[inline] pub fn bad_request() -> Response { - Response::new(StatusCode::OK) + Response::new(StatusCode::BAD_REQUEST) } /// Creates a new response with status 404 Not Found. @@ -304,7 +304,7 @@ impl ResponseBuilder { /// /// ``` /// # use actix_http::Response; - /// use actix_http::http::header; + /// use actix_http::http::{header, StatusCode}; /// /// Response::build(StatusCode::OK) /// .insert_header((header::CONTENT_TYPE, mime::APPLICATION_JSON)) @@ -331,7 +331,7 @@ impl ResponseBuilder { /// /// ``` /// # use actix_http::Response; - /// use actix_http::http::header; + /// use actix_http::http::{header, StatusCode}; /// /// Response::build(StatusCode::OK) /// .append_header((header::CONTENT_TYPE, mime::APPLICATION_JSON))