Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not add a
Content-Type
header to the HTTP upgrade request (#127)
Do not add a `Content-Type` header to the HTTP upgrade request. Fixes #126. [Some](https://alpaca.markets/docs/api-references/trading-api/streaming/) WebSocket servers use the `Content-Type` header to determine which serialization format to use for its WebSocket messages. However, `HTTPInitialRequestHandler` [adds](https://github.com/vapor/websocket-kit/blob/62f568aa9d338aa33790534fa7b5800976f93af8/Sources/WebSocketKit/HTTPInitialRequestHandler.swift#L24) a hard-coded `Content-Type: text/plain; charset=utf-8` header to the WebSocket client’s HTTP upgrade request, so the client cannot customize the header value. Given that the HTTP upgrade request body is empty, there is no need for `HTTPInitialRequestHandler` to add the `Content-Type` header. This will allow the client to add their own, if desired. Co-authored-by: fumoboy007 <fumoboy007@me.com> Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
- Loading branch information