diff --git a/CHANGES.md b/CHANGES.md index 96a81a03c..608c237b2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,7 @@ ## Unreleased - 2020-xx-xx ### Changed * Add `TrailingSlash::MergeOnly` behaviour to `NormalizePath`, which allow `NormalizePath` - to keep the trailing slash's existance as it is. fix [#1694] [#1695] + to keep the trailing slash's existance as it is. [#1695] ## 3.0.2 - 2020-09-15 diff --git a/src/middleware/normalize.rs b/src/middleware/normalize.rs index 309c113fe..e0ecd90dc 100644 --- a/src/middleware/normalize.rs +++ b/src/middleware/normalize.rs @@ -17,8 +17,9 @@ pub enum TrailingSlash { /// Always add a trailing slash to the end of the path. /// This will require all routes to end in a trailing slash for them to be accessible. Always, - /// Neither add nor trim slash at end of path. Merge multiple slashes only - /// This is compatible with actix-web 2.0 + /// Only merge any present multiple trailing slashes. + /// + /// Note: This option provides the best compatibility with the v2 version of this middlware. MergeOnly, /// Trim trailing slashes from the end of the path. Trim, @@ -36,7 +37,8 @@ impl Default for TrailingSlash { /// Performs following: /// /// - Merges multiple slashes into one. -/// - Appends a trailing slash if one is not present, or removes one if present, or keep trailing slash's existance as it was, depending on the supplied `TrailingSlash`. +/// - Appends a trailing slash if one is not present, removes one if present, or keeps trailing +/// slashes as-is, depending on the supplied `TrailingSlash` variant. /// /// ```rust /// use actix_web::{web, http, middleware, App, HttpResponse};