Add slash trim middleware
This commit is contained in:
parent
16dbc8e3c5
commit
a87c9ef510
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1252,7 +1252,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pict-rs-proxy"
|
||||
version = "0.4.0-alpha.3"
|
||||
version = "0.4.0-alpha.4"
|
||||
dependencies = [
|
||||
"actix-rt",
|
||||
"actix-web",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "pict-rs-proxy"
|
||||
description = "A simple web frontend for pict-rs"
|
||||
version = "0.4.0-alpha.3"
|
||||
version = "0.4.0-alpha.4"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
license = "AGPL-3.0"
|
||||
readme = "README.md"
|
||||
|
|
|
@ -7,6 +7,7 @@ use actix_web::{
|
|||
header::{CacheControl, CacheDirective, ContentType, LastModified, LOCATION},
|
||||
StatusCode,
|
||||
},
|
||||
middleware::NormalizePath,
|
||||
web, App, HttpRequest, HttpResponse, HttpResponseBuilder, HttpServer, ResponseError,
|
||||
};
|
||||
use awc::Client;
|
||||
|
@ -909,6 +910,7 @@ async fn main() -> Result<(), anyhow::Error> {
|
|||
|
||||
App::new()
|
||||
.app_data(web::Data::new(client))
|
||||
.wrap(NormalizePath::trim())
|
||||
.wrap(TracingLogger::default())
|
||||
.service(web::resource("/").route(web::get().to(index)))
|
||||
.service(
|
||||
|
|
Loading…
Reference in a new issue