1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

Drop content length headers from 101 responses (#1767)

Co-authored-by: Sebastian Mayr <smayr@atlassian.com>
This commit is contained in:
Sebastian Mayr
2020-11-02 03:44:14 -05:00
committed by GitHub
parent b6385c2b4e
commit 5468c3c410
3 changed files with 41 additions and 11 deletions

View File

@ -164,7 +164,6 @@ pub fn handshake_with_protocols(
let mut response = HttpResponse::build(StatusCode::SWITCHING_PROTOCOLS)
.upgrade("websocket")
.header(header::TRANSFER_ENCODING, "chunked")
.header(header::SEC_WEBSOCKET_ACCEPT, key.as_str())
.take();
@ -664,10 +663,10 @@ mod tests {
)
.to_http_request();
assert_eq!(
StatusCode::SWITCHING_PROTOCOLS,
handshake(&req).unwrap().finish().status()
);
let resp = handshake(&req).unwrap().finish();
assert_eq!(StatusCode::SWITCHING_PROTOCOLS, resp.status());
assert_eq!(None, resp.headers().get(&header::CONTENT_LENGTH));
assert_eq!(None, resp.headers().get(&header::TRANSFER_ENCODING));
let req = TestRequest::default()
.header(