mirror of https://github.com/fafhrd91/actix-web
format
This commit is contained in:
parent
4c9d4d5b86
commit
bdb167b54a
|
@ -16,9 +16,9 @@ use futures_util::ready;
|
||||||
use rand::{distributions::Alphanumeric, Rng};
|
use rand::{distributions::Alphanumeric, Rng};
|
||||||
|
|
||||||
use actix_web::dev::BodyEncoding;
|
use actix_web::dev::BodyEncoding;
|
||||||
|
use actix_web::middleware::normalize::TrailingSlash;
|
||||||
use actix_web::middleware::{Compress, NormalizePath};
|
use actix_web::middleware::{Compress, NormalizePath};
|
||||||
use actix_web::{dev, test, web, App, Error, HttpResponse};
|
use actix_web::{dev, test, web, App, Error, HttpResponse};
|
||||||
use actix_web::middleware::normalize::TrailingSlash;
|
|
||||||
|
|
||||||
const STR: &str = "Hello World Hello World Hello World Hello World Hello World \
|
const STR: &str = "Hello World Hello World Hello World Hello World Hello World \
|
||||||
Hello World Hello World Hello World Hello World Hello World \
|
Hello World Hello World Hello World Hello World Hello World \
|
||||||
|
@ -872,14 +872,12 @@ async fn test_normalize() {
|
||||||
let srv = test::start_with(test::config().h1(), || {
|
let srv = test::start_with(test::config().h1(), || {
|
||||||
App::new()
|
App::new()
|
||||||
.wrap(NormalizePath::new(TrailingSlash::Trim))
|
.wrap(NormalizePath::new(TrailingSlash::Trim))
|
||||||
.service(web::resource("/one").route(web::to(|| HttpResponse::Ok().finish())))
|
.service(
|
||||||
|
web::resource("/one").route(web::to(|| HttpResponse::Ok().finish())),
|
||||||
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
let response = srv
|
let response = srv.get("/one/").send().await.unwrap();
|
||||||
.get("/one/")
|
|
||||||
.send()
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
assert!(response.status().is_success());
|
assert!(response.status().is_success());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue