Add slash trim middleware
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/tag Build is passing

This commit is contained in:
asonix 2022-06-06 17:25:05 -05:00
parent 16dbc8e3c5
commit a87c9ef510
3 changed files with 4 additions and 2 deletions

2
Cargo.lock generated
View file

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

View file

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

View file

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