Append @robjtede changes request in PR #1695

- Rewrite comments & changes

Signed-off-by: 劉安 <liuan@sgcc.com.cn>
This commit is contained in:
劉安 2020-09-25 17:53:17 +08:00
parent 22902343d7
commit 6ff4da7ccd
No known key found for this signature in database
GPG Key ID: 91C437F1FCF57B8A
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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};