1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 17:46:38 +02:00

do not override content-length header

This commit is contained in:
Nikolay Kim
2018-10-08 15:30:59 -07:00
parent 07f6ca4b71
commit 4e7fac08b9
3 changed files with 19 additions and 14 deletions

View File

@@ -191,15 +191,13 @@ impl Output {
let transfer = match resp.body() {
Body::Empty => {
if !info.head {
info.length = match resp.status() {
StatusCode::NO_CONTENT
| StatusCode::CONTINUE
| StatusCode::SWITCHING_PROTOCOLS
| StatusCode::PROCESSING => ResponseLength::None,
_ => ResponseLength::Zero,
};
}
info.length = match resp.status() {
StatusCode::NO_CONTENT
| StatusCode::CONTINUE
| StatusCode::SWITCHING_PROTOCOLS
| StatusCode::PROCESSING => ResponseLength::None,
_ => ResponseLength::Zero,
};
*self = Output::Empty(buf);
return;
}