1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00

drop connection if handler get dropped without consuming payload

This commit is contained in:
Nikolay Kim
2018-02-27 16:08:57 -08:00
parent 9b06eac720
commit e2c8f17c2c
5 changed files with 35 additions and 30 deletions

View File

@ -71,24 +71,12 @@ impl ClientResponse {
self.as_ref().version
}
/// Get a mutable reference to the headers.
#[inline]
pub fn headers_mut(&mut self) -> &mut HeaderMap {
&mut self.as_mut().headers
}
/// Get the status from the server.
#[inline]
pub fn status(&self) -> StatusCode {
self.as_ref().status
}
/// Set the `StatusCode` for this response.
#[inline]
pub fn set_status(&mut self, status: StatusCode) {
self.as_mut().status = status
}
/// Load request cookies.
pub fn cookies(&self) -> Result<&Vec<Cookie<'static>>, CookieParseError> {
if self.as_ref().cookies.is_none() {