fix redirect to "/" in /api/thumb
parent
28b7fc8904
commit
2c36373d85
|
@ -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()),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue