mirror of https://github.com/fafhrd91/actix-web
Compare commits
7 Commits
a0c30f8d40
...
5edcba341a
Author | SHA1 | Date |
---|---|---|
|
5edcba341a | |
|
3f9d88f859 | |
|
2eb801cb59 | |
|
afad1db343 | |
|
1098d0deb7 | |
|
5dcad17a61 | |
|
5f1a4607e5 |
|
@ -49,7 +49,7 @@ jobs:
|
|||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||
uses: taiki-e/install-action@v2.54.0
|
||||
uses: taiki-e/install-action@v2.54.3
|
||||
with:
|
||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||
|
||||
|
@ -83,7 +83,7 @@ jobs:
|
|||
uses: actions-rust-lang/setup-rust-toolchain@v1.13.0
|
||||
|
||||
- name: Install just, cargo-hack
|
||||
uses: taiki-e/install-action@v2.54.0
|
||||
uses: taiki-e/install-action@v2.54.3
|
||||
with:
|
||||
tool: just,cargo-hack
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ jobs:
|
|||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||
uses: taiki-e/install-action@v2.54.0
|
||||
uses: taiki-e/install-action@v2.54.3
|
||||
with:
|
||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||
|
||||
|
@ -113,7 +113,7 @@ jobs:
|
|||
toolchain: nightly
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@v2.54.0
|
||||
uses: taiki-e/install-action@v2.54.3
|
||||
with:
|
||||
tool: just
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ jobs:
|
|||
components: llvm-tools
|
||||
|
||||
- name: Install just, cargo-llvm-cov, cargo-nextest
|
||||
uses: taiki-e/install-action@v2.54.0
|
||||
uses: taiki-e/install-action@v2.54.3
|
||||
with:
|
||||
tool: just,cargo-llvm-cov,cargo-nextest
|
||||
|
||||
|
|
|
@ -77,12 +77,12 @@ jobs:
|
|||
toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@v2.54.0
|
||||
uses: taiki-e/install-action@v2.54.3
|
||||
with:
|
||||
tool: just
|
||||
|
||||
- name: Install cargo-check-external-types
|
||||
uses: taiki-e/cache-cargo-install-action@v2.1.2
|
||||
uses: taiki-e/cache-cargo-install-action@v2.2.0
|
||||
with:
|
||||
tool: cargo-check-external-types
|
||||
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
|
||||
- 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
|
||||
|
||||
### Added
|
||||
|
|
|
@ -391,8 +391,20 @@ impl MessageType for ResponseHead {
|
|||
// switching protocol or connect
|
||||
PayloadType::Stream(PayloadDecoder::eof())
|
||||
} else {
|
||||
// for HTTP/1.0 read to eof and close connection
|
||||
if msg.version == Version::HTTP_10 {
|
||||
let body_allowed = match msg.status.as_u16() {
|
||||
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);
|
||||
PayloadType::Payload(PayloadDecoder::eof())
|
||||
} else {
|
||||
|
|
|
@ -749,7 +749,7 @@ async fn client_unread_response() {
|
|||
|
||||
// awc does not read all bytes unless content-length is specified
|
||||
let bytes = res.body().await.unwrap();
|
||||
assert_eq!(bytes, Bytes::from_static(b""));
|
||||
assert_eq!(bytes, Bytes::from_static(b"welcome!"));
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
|
|
Loading…
Reference in New Issue