Skip to content

Fix panic risks and compile error in WebSocketTransport::connect #2

Description

@coderabbitai

Description

The WebSocketTransport::connect method in client/src/transport/ws.rs (lines 21-41) has several issues that need to be addressed:

  1. Panic risks: The code uses .unwrap() on both URI parsing and host extraction, which can cause panics on invalid input
  2. Compile error: The sec-websocket-version header is set to integer literal 13 instead of a string, which doesn't implement TryInto<HeaderValue>
  3. Missing port: The host header should include the port when present in the URI

Reference

Files

  • client/src/transport/ws.rs lines 21-41

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions