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

port hyper header

This commit is contained in:
Nikolay Kim
2018-03-06 00:43:25 -08:00
parent e182ed33b1
commit 32b5544ad9
36 changed files with 3639 additions and 166 deletions

View File

@ -16,7 +16,6 @@ use bytes::{Bytes, BytesMut, BufMut};
use header::ContentEncoding;
use body::{Body, Binary};
use error::PayloadError;
use helpers::convert_usize;
use httprequest::HttpInnerMessage;
use httpresponse::HttpResponse;
use payload::{PayloadSender, PayloadWriter, PayloadStatus};
@ -422,7 +421,7 @@ impl ContentEncoder {
}
if req.method == Method::HEAD {
let mut b = BytesMut::new();
convert_usize(bytes.len(), &mut b);
let _ = write!(b, "{}", bytes.len());
resp.headers_mut().insert(
CONTENT_LENGTH, HeaderValue::try_from(b.freeze()).unwrap());
} else {