mirror of https://github.com/fafhrd91/actix-web
Compare commits
6 Commits
f1a859c48d
...
9d91d301f4
| Author | SHA1 | Date |
|---|---|---|
|
|
9d91d301f4 | |
|
|
e1da110e92 | |
|
|
afad1db343 | |
|
|
1098d0deb7 | |
|
|
5dcad17a61 | |
|
|
5f1a4607e5 |
|
|
@ -45,6 +45,10 @@
|
||||||
|
|
||||||
- Add `error::InvalidStatusCode` re-export.
|
- Add `error::InvalidStatusCode` re-export.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix `MessageType::set_headers` not using the correct payload decoder when Transfer-Encoding and Content-Length are absent.
|
||||||
|
|
||||||
## 3.7.0
|
## 3.7.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -391,8 +391,20 @@ impl MessageType for ResponseHead {
|
||||||
// switching protocol or connect
|
// switching protocol or connect
|
||||||
PayloadType::Stream(PayloadDecoder::eof())
|
PayloadType::Stream(PayloadDecoder::eof())
|
||||||
} else {
|
} else {
|
||||||
// for HTTP/1.0 read to eof and close connection
|
let body_allowed = match msg.status.as_u16() {
|
||||||
if msg.version == Version::HTTP_10 {
|
100..=199 => false,
|
||||||
|
204 => false,
|
||||||
|
304 => false,
|
||||||
|
_ => true,
|
||||||
|
};
|
||||||
|
// for HTTP/1.0 and HTTP/1.1 read to eof and close connection
|
||||||
|
if msg.version == Version::HTTP_11 && body_allowed {
|
||||||
|
if let Some(ConnectionType::Close) = msg.conn_type() {
|
||||||
|
PayloadType::Payload(PayloadDecoder::eof())
|
||||||
|
} else {
|
||||||
|
PayloadType::None
|
||||||
|
}
|
||||||
|
} else if msg.version == Version::HTTP_10 {
|
||||||
msg.set_connection_type(ConnectionType::Close);
|
msg.set_connection_type(ConnectionType::Close);
|
||||||
PayloadType::Payload(PayloadDecoder::eof())
|
PayloadType::Payload(PayloadDecoder::eof())
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
- `actix_web::response::builder::HttpResponseBuilder::streaming()` now sets `Content-Type` to `application/octet-stream` if `Content-Type` does not exist.
|
- `actix_web::response::builder::HttpResponseBuilder::streaming()` now sets `Content-Type` to `application/octet-stream` if `Content-Type` does not exist.
|
||||||
- `actix_web::response::builder::HttpResponseBuilder::streaming()` now calls `actix_web::response::builder::HttpResponseBuilder::no_chunking()` if `Content-Length` is set by user.
|
- `actix_web::response::builder::HttpResponseBuilder::streaming()` now calls `actix_web::response::builder::HttpResponseBuilder::no_chunking()` if `Content-Length` is set by user.
|
||||||
- Add `ws` crate feature (on-by-default) which forwards to `actix-http` and guards some of its `ResponseError` impls.
|
- Add `ws` crate feature (on-by-default) which forwards to `actix-http` and guards some of its `ResponseError` impls.
|
||||||
|
- Add public export for `EitherExtractError` in `error` module.
|
||||||
|
|
||||||
## 4.11.0
|
## 4.11.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ mod response_error;
|
||||||
|
|
||||||
pub(crate) use self::macros::{downcast_dyn, downcast_get_type_id};
|
pub(crate) use self::macros::{downcast_dyn, downcast_get_type_id};
|
||||||
pub use self::{error::Error, internal::*, response_error::ResponseError};
|
pub use self::{error::Error, internal::*, response_error::ResponseError};
|
||||||
|
pub use crate::types::EitherExtractError;
|
||||||
|
|
||||||
/// A convenience [`Result`](std::result::Result) for Actix Web operations.
|
/// A convenience [`Result`](std::result::Result) for Actix Web operations.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ mod query;
|
||||||
mod readlines;
|
mod readlines;
|
||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
either::Either,
|
either::{Either, EitherExtractError},
|
||||||
form::{Form, FormConfig, UrlEncoded},
|
form::{Form, FormConfig, UrlEncoded},
|
||||||
header::Header,
|
header::Header,
|
||||||
html::Html,
|
html::Html,
|
||||||
|
|
|
||||||
|
|
@ -749,7 +749,7 @@ async fn client_unread_response() {
|
||||||
|
|
||||||
// awc does not read all bytes unless content-length is specified
|
// awc does not read all bytes unless content-length is specified
|
||||||
let bytes = res.body().await.unwrap();
|
let bytes = res.body().await.unwrap();
|
||||||
assert_eq!(bytes, Bytes::from_static(b""));
|
assert_eq!(bytes, Bytes::from_static(b"welcome!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue