|
|
@ -135,7 +135,12 @@ fn generate_request(request: Request, key: &str) -> Result<Vec<u8>> { |
|
|
|
key = key |
|
|
|
key = key |
|
|
|
) |
|
|
|
) |
|
|
|
.unwrap(); |
|
|
|
.unwrap(); |
|
|
|
|
|
|
|
|
|
|
|
for (k, v) in request.headers() { |
|
|
|
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", k, v.to_str()?).unwrap(); |
|
|
|
} |
|
|
|
} |
|
|
|
writeln!(req, "\r").unwrap(); |
|
|
|
writeln!(req, "\r").unwrap(); |
|
|
|