Description
The WebSocketTransport::connect method in client/src/transport/ws.rs (lines 21-41) has several issues that need to be addressed:
- Panic risks: The code uses
.unwrap() on both URI parsing and host extraction, which can cause panics on invalid input
- Compile error: The
sec-websocket-version header is set to integer literal 13 instead of a string, which doesn't implement TryInto<HeaderValue>
- Missing port: The host header should include the port when present in the URI
Reference
Files
client/src/transport/ws.rs lines 21-41
Description
The
WebSocketTransport::connectmethod inclient/src/transport/ws.rs(lines 21-41) has several issues that need to be addressed:.unwrap()on both URI parsing and host extraction, which can cause panics on invalid inputsec-websocket-versionheader is set to integer literal13instead of a string, which doesn't implementTryInto<HeaderValue>Reference
Files
client/src/transport/ws.rslines 21-41