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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user