1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 09:59:21 +02:00

Correct settings headers for HTTP2

Add test to verify number of Set-Cookies
This commit is contained in:
Douman
2018-08-04 01:34:23 +03:00
parent 84b27db218
commit 900fd5a98e
2 changed files with 47 additions and 3 deletions

View File

@ -112,7 +112,7 @@ impl<H: 'static> Writer for H2Writer<H> {
DATE => has_date = true,
_ => (),
}
resp.headers_mut().insert(key, value.clone());
resp.headers_mut().append(key, value.clone());
}
// set date header
@ -151,6 +151,8 @@ impl<H: 'static> Writer for H2Writer<H> {
.insert(CONTENT_ENCODING, HeaderValue::try_from(ce).unwrap());
}
trace!("Response: {:?}", resp);
match self
.respond
.send_response(resp, self.flags.contains(Flags::EOF))
@ -159,8 +161,6 @@ impl<H: 'static> Writer for H2Writer<H> {
Err(_) => return Err(io::Error::new(io::ErrorKind::Other, "err")),
}
trace!("Response: {:?}", msg);
let body = msg.replace_body(Body::Empty);
if let Body::Binary(bytes) = body {
if bytes.is_empty() {