diff --git a/CHANGES.md b/CHANGES.md index 0c9a70812..733f28ca7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,7 +15,7 @@ * Public field of `web::Query` has been made private. [#1894] [#1891]: https://github.com/actix/actix-web/pull/1891 -[#????]: https://github.com/actix/actix-web/pull/???? +[#1894]: https://github.com/actix/actix-web/pull/1894 ## 4.0.0-beta.1 - 2021-01-07 ### Added diff --git a/src/responder.rs b/src/responder.rs index b0292ed0d..9b33ac81a 100644 --- a/src/responder.rs +++ b/src/responder.rs @@ -110,7 +110,7 @@ impl Responder for (T, StatusCode) { impl Responder for &'static str { fn respond_to(self, _: &HttpRequest) -> HttpResponse { HttpResponse::Ok() - .content_type("text/plain; charset=utf-8") + .content_type(mime::TEXT_PLAIN_UTF_8) .body(self) } } @@ -118,7 +118,7 @@ impl Responder for &'static str { impl Responder for &'static [u8] { fn respond_to(self, _: &HttpRequest) -> HttpResponse { HttpResponse::Ok() - .content_type("application/octet-stream") + .content_type(mime::APPLICATION_OCTET_STREAM) .body(self) } } @@ -126,7 +126,7 @@ impl Responder for &'static [u8] { impl Responder for String { fn respond_to(self, _: &HttpRequest) -> HttpResponse { HttpResponse::Ok() - .content_type("text/plain; charset=utf-8") + .content_type(mime::TEXT_PLAIN_UTF_8) .body(self) } } @@ -134,7 +134,7 @@ impl Responder for String { impl<'a> Responder for &'a String { fn respond_to(self, _: &HttpRequest) -> HttpResponse { HttpResponse::Ok() - .content_type("text/plain; charset=utf-8") + .content_type(mime::TEXT_PLAIN_UTF_8) .body(self) } } @@ -142,7 +142,7 @@ impl<'a> Responder for &'a String { impl Responder for Bytes { fn respond_to(self, _: &HttpRequest) -> HttpResponse { HttpResponse::Ok() - .content_type("application/octet-stream") + .content_type(mime::APPLICATION_OCTET_STREAM) .body(self) } } @@ -150,7 +150,7 @@ impl Responder for Bytes { impl Responder for BytesMut { fn respond_to(self, _: &HttpRequest) -> HttpResponse { HttpResponse::Ok() - .content_type("application/octet-stream") + .content_type(mime::APPLICATION_OCTET_STREAM) .body(self) } } diff --git a/src/types/either.rs b/src/types/either.rs index 229ad69a0..d72a14fd0 100644 --- a/src/types/either.rs +++ b/src/types/either.rs @@ -1,5 +1,4 @@ //! For either helper, see [`Either`]. -// TODO: could we just use either::Either? use bytes::Bytes; use futures_util::{future::LocalBoxFuture, FutureExt, TryFutureExt}; diff --git a/src/types/form.rs b/src/types/form.rs index b5bf07596..71680b19a 100644 --- a/src/types/form.rs +++ b/src/types/form.rs @@ -1,4 +1,4 @@ -//! For form-urlencoded helper documentation, see [`Form`]. +//! For URL encoded form helper documentation, see [`Form`]. use std::{ fmt,