1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-27 20:11:15 +00:00

Merge pull request #1370 from mattgathu/feat/helper-function-for-trace-method

Create helper function for HTTP Trace Method
This commit is contained in:
Yuki Okushi 2020-02-25 14:24:09 +09:00 committed by GitHub
commit 2a8e5fdc73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -3,6 +3,10 @@
## [2.0.NEXT] - 2020-01-xx
### Added
* Add helper function for creating routes with `TRACE` method guard `web::trace()`
### Changed
* Use `sha-1` crate instead of unmaintained `sha1` crate

View file

@ -193,6 +193,24 @@ pub fn head() -> Route {
method(Method::HEAD)
}
/// Create *route* with `TRACE` method guard.
///
/// ```rust
/// use actix_web::{web, App, HttpResponse};
///
/// let app = App::new().service(
/// web::resource("/{project_id}")
/// .route(web::trace().to(|| HttpResponse::Ok()))
/// );
/// ```
///
/// In the above example, one `HEAD` route gets added:
/// * /{project_id}
///
pub fn trace() -> Route {
method(Method::TRACE)
}
/// Create *route* and add method guard.
///
/// ```rust