fix redirect to "/" in /api/thumb

feat/vaults
Tomáš Mládek 2022-02-07 10:23:17 +01:00
parent 28b7fc8904
commit 2c36373d85
No known key found for this signature in database
GPG Key ID: ED21612889E75EC5
1 changed files with 3 additions and 3 deletions

View File

@ -151,7 +151,7 @@ pub async fn get_thumbnail(
} else {
return Ok(Either::B(
HttpResponse::SeeOther()
.header(http::header::LOCATION, format!("/api/raw/{hash}"))
.header(http::header::LOCATION, format!("../../api/raw/{hash}"))
.finish(),
));
}
@ -393,7 +393,7 @@ pub async fn list_hier(
let connection = state.upend.connection().map_err(ErrorInternalServerError)?;
if path.is_empty() {
Ok(HttpResponse::MovedPermanently()
.header("Location", "/api/hier_roots")
.header(http::header::LOCATION, "../../api/hier_roots")
.finish())
} else {
let upath: UHierPath = path.into_inner().parse().map_err(ErrorBadRequest)?;
@ -403,7 +403,7 @@ pub async fn list_hier(
let path = resolve_path(&connection, &upath, false).map_err(ErrorNotFound)?;
match path.last() {
Some(addr) => Ok(HttpResponse::Found()
.header("Location", format!("/api/obj/{}", addr))
.header(http::header::LOCATION, format!("../../api/obj/{}", addr))
.finish()),
None => Ok(HttpResponse::NotFound().finish()),
}