vapor / websocket-kit

WebSocket client library built on SwiftNIO

Home Page:https://docs.vapor.codes/4.0/advanced/websockets/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

query part is chopped from the URL

gazsiazasz opened this issue · comments

Describe the bug

An URL which contains "query" part, it is silently omitted by the websocket-kit. So it is possible to not be able to connect to a WebSocket because it can contain essential information to connect.

To Reproduce

    let wss = "wss://wssserver.com/endpoint/?essentialinfo=here"
   WebSocket.connect(to: wss, headers: headers, on: app.eventLoopGroup, onUpgrade: {...})

Steps to reproduce the behavior:

  1. Add package with default configuration
  2. Send request with options above
  3. See error

Expected behavior

It should use the query part of the URL (why don't u use simply URL and URLComponents from the Foundation lib instead of the hackery done in this lib? :))

Environment

Xcode: Version 13.0 beta (13A5154h)

  • Vapor Framework version: 4.47.0
  • Vapor Toolbox version: -
  • OS version: 12.0 (21A5248p)

Additional context