Applications, Cluster node management and minor fixes
This commit is contained in:
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user