mirror of https://github.com/fafhrd91/actix-web
Append @robjtede changes request in PR #1695
- Rewrite comments & changes Signed-off-by: 劉安 <liuan@sgcc.com.cn>
This commit is contained in:
parent
22902343d7
commit
6ff4da7ccd
|
@ -3,7 +3,7 @@
|
||||||
## Unreleased - 2020-xx-xx
|
## Unreleased - 2020-xx-xx
|
||||||
### Changed
|
### Changed
|
||||||
* Add `TrailingSlash::MergeOnly` behaviour to `NormalizePath`, which allow `NormalizePath`
|
* 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
|
## 3.0.2 - 2020-09-15
|
||||||
|
|
|
@ -17,8 +17,9 @@ pub enum TrailingSlash {
|
||||||
/// Always add a trailing slash to the end of the path.
|
/// 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.
|
/// This will require all routes to end in a trailing slash for them to be accessible.
|
||||||
Always,
|
Always,
|
||||||
/// Neither add nor trim slash at end of path. Merge multiple slashes only
|
/// Only merge any present multiple trailing slashes.
|
||||||
/// This is compatible with actix-web 2.0
|
///
|
||||||
|
/// Note: This option provides the best compatibility with the v2 version of this middlware.
|
||||||
MergeOnly,
|
MergeOnly,
|
||||||
/// Trim trailing slashes from the end of the path.
|
/// Trim trailing slashes from the end of the path.
|
||||||
Trim,
|
Trim,
|
||||||
|
@ -36,7 +37,8 @@ impl Default for TrailingSlash {
|
||||||
/// Performs following:
|
/// Performs following:
|
||||||
///
|
///
|
||||||
/// - Merges multiple slashes into one.
|
/// - 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
|
/// ```rust
|
||||||
/// use actix_web::{web, http, middleware, App, HttpResponse};
|
/// use actix_web::{web, http, middleware, App, HttpResponse};
|
||||||
|
|
Loading…
Reference in New Issue