Applications, Cluster node management and minor fixes

This commit is contained in:
Maurus Decimus
2026-04-14 20:28:47 +02:00
parent f3dfb7cb33
commit f6c91041d9
47 changed files with 745 additions and 254 deletions

View File

@@ -27,6 +27,15 @@ impl HttpResponse {
}
}
pub fn redirect(location: String) -> Self {
let mut response = HttpResponse::new(StatusCode::FOUND);
response.builder = response
.builder
.status(StatusCode::FOUND)
.header(header::LOCATION, location);
response
}
pub fn with_content_type<V>(mut self, content_type: V) -> Self
where
V: TryInto<HeaderValue>,
@@ -154,6 +163,13 @@ impl HttpResponse {
self
}
pub fn with_immutable_cache(mut self) -> Self {
self.builder = self
.builder
.header(header::CACHE_CONTROL, "public, max-age=31536000, immutable");
self
}
pub fn with_location<V>(mut self, location: V) -> Self
where
V: TryInto<HeaderValue>,