fix ws subportocol lowercase header

pull/119/head
Yan 5 years ago
parent 366700342b
commit 16a33df195
  1. 5
      src/handshake/client.rs

@ -135,7 +135,12 @@ fn generate_request(request: Request, key: &str) -> Result<Vec<u8>> {
key = key
)
.unwrap();
for (k, v) in request.headers() {
let mut k = k.as_str();
if k == "sec-websocket-protocol".to_string(){
k = "Sec-WebSocket-Protocol";
}
writeln!(req, "{}: {}\r", k, v.to_str()?).unwrap();
}
writeln!(req, "\r").unwrap();

Loading…
Cancel
Save