|
|
|
@ -135,7 +135,7 @@ fn generate_request(mut request: Request) -> Result<(Vec<u8>, String)> { |
|
|
|
|
HeaderName::from_bytes(header.as_bytes()).unwrap(), |
|
|
|
|
)) |
|
|
|
|
})?; |
|
|
|
|
write!(req, "{header}: {value}\r\n", value = value.to_str()?).unwrap(); |
|
|
|
|
write!(req, "{header}: {value}\r\n", header = header, value = value.to_str()?).unwrap(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Now we must ensure that the headers that we've written once are not anymore present in the map.
|
|
|
|
@ -300,7 +300,9 @@ mod tests { |
|
|
|
|
Upgrade: websocket\r\n\ |
|
|
|
|
Sec-WebSocket-Version: 13\r\n\ |
|
|
|
|
Sec-WebSocket-Key: {key}\r\n\ |
|
|
|
|
\r\n" |
|
|
|
|
\r\n", |
|
|
|
|
host = host, |
|
|
|
|
key = key |
|
|
|
|
) |
|
|
|
|
.into_bytes() |
|
|
|
|
} |
|
|
|
|