Skip to content

Commit

Permalink
Merge pull request #119 from kids300/master
Browse files Browse the repository at this point in the history
Fix ws request subportocol lowercase header
  • Loading branch information
daniel-abramov authored Jun 24, 2020
2 parents 744bd87 + fb83e8c commit 6791dcc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/handshake/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
k = "Sec-WebSocket-Protocol";
}
writeln!(req, "{}: {}\r", k, v.to_str()?).unwrap();
}
writeln!(req, "\r").unwrap();
Expand Down

0 comments on commit 6791dcc

Please sign in to comment.