update changelog

This commit is contained in:
Rob Ede 2021-01-05 03:09:08 +00:00
parent d5bdafac74
commit e6f1e01707
No known key found for this signature in database
GPG Key ID: C2A3B36E841A91E6
4 changed files with 9 additions and 19 deletions

View File

@ -11,8 +11,8 @@
* Update `rust-tls` to `0.19`. [#1813] * Update `rust-tls` to `0.19`. [#1813]
* Rename `Handler` to `HandlerService` and rename `Factory` to `Handler`. [#1852] * Rename `Handler` to `HandlerService` and rename `Factory` to `Handler`. [#1852]
* The default `TrailingSlash` is now `Trim`, in line with existing documentation. See migration * The default `TrailingSlash` is now `Trim`, in line with existing documentation. See migration
guide for implications. [#????] guide for implications. [#1875]
* Rename `DefaultHeaders::{content_type => add_content_type}`. [#????] * Rename `DefaultHeaders::{content_type => add_content_type}`. [#1875]
* MSRV is now 1.46.0. * MSRV is now 1.46.0.
### Fixed ### Fixed
@ -26,7 +26,7 @@
[#1813]: https://github.com/actix/actix-web/pull/1813 [#1813]: https://github.com/actix/actix-web/pull/1813
[#1852]: https://github.com/actix/actix-web/pull/1852 [#1852]: https://github.com/actix/actix-web/pull/1852
[#1865]: https://github.com/actix/actix-web/pull/1865 [#1865]: https://github.com/actix/actix-web/pull/1865
[#????]: https://github.com/actix/actix-web/pull/???? [#1875]: https://github.com/actix/actix-web/pull/1875
## 3.3.2 - 2020-12-01 ## 3.3.2 - 2020-12-01

View File

@ -18,8 +18,7 @@ async fn no_params() -> &'static str {
#[actix_web::main] #[actix_web::main]
async fn main() -> std::io::Result<()> { async fn main() -> std::io::Result<()> {
std::env::set_var("RUST_LOG", "actix_server=info,actix_web=info"); env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
env_logger::init();
HttpServer::new(|| { HttpServer::new(|| {
App::new() App::new()

View File

@ -9,13 +9,13 @@ use std::{
task::{Context, Poll}, task::{Context, Poll},
}; };
use actix_service::{Service, Transform};
use futures_util::{ use futures_util::{
future::{ready, Ready}, future::{ready, Ready},
ready, ready,
}; };
use crate::{ use crate::{
dev::{Service, Transform},
http::{ http::{
header::{HeaderName, HeaderValue, CONTENT_TYPE}, header::{HeaderName, HeaderValue, CONTENT_TYPE},
Error as HttpError, HeaderMap, Error as HttpError, HeaderMap,

View File

@ -48,9 +48,10 @@ impl Default for TrailingSlash {
/// to [`new`](NormalizePath::new()). /// to [`new`](NormalizePath::new()).
/// ///
/// # Default Behavior /// # Default Behavior
/// The default constructor chooses to append trailing slashes to the end of paths without them /// The default constructor chooses to strip trailing slashes from the end of paths with them
/// ([`TrailingSlash::Always`]), the effect is that route definitions should be defined with /// ([`TrailingSlash::Trim`]). The implication is that route definitions should be defined without
/// trailing slashes or else they will be inaccessible, or vice versa when using the trim behavior. /// trailing slashes or else they will be inaccessible (or vice versa when using the
/// `TrailingSlash::Always` behavior), as shown in the example tests below.
/// ///
/// # Usage /// # Usage
/// ```rust /// ```rust
@ -92,16 +93,6 @@ impl NormalizePath {
pub fn new(trailing_slash_style: TrailingSlash) -> Self { pub fn new(trailing_slash_style: TrailingSlash) -> Self {
NormalizePath(trailing_slash_style) NormalizePath(trailing_slash_style)
} }
/// Shortcut for new `NormalizePath::new(TrailingSlash::Trim)`.
pub fn trim() -> Self {
NormalizePath::new(TrailingSlash::Trim)
}
/// Shortcut for new `NormalizePath::new(TrailingSlash::MergeOnly)`.
pub fn merge_only() -> Self {
NormalizePath::new(TrailingSlash::MergeOnly)
}
} }
impl<S, B> Transform<S, ServiceRequest> for NormalizePath impl<S, B> Transform<S, ServiceRequest> for NormalizePath