Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmk committed Apr 28, 2024
1 parent 5c207f5 commit ca1eb11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Sources/Nats/HTTPUpgradeRequestHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ internal final class HTTPUpgradeRequestHandler: ChannelInboundHandler, Removable

private var requestSent = false

init(host: String, path: String, query: String?, headers: HTTPHeaders, upgradePromise: EventLoopPromise<Void>) {
init(
host: String, path: String, query: String?, headers: HTTPHeaders,
upgradePromise: EventLoopPromise<Void>
) {
self.host = host
self.path = path
self.query = query
Expand Down Expand Up @@ -58,7 +61,8 @@ internal final class HTTPUpgradeRequestHandler: ChannelInboundHandler, Removable
headers.add(name: "Host", value: self.host)

var uri: String
if self.path.hasPrefix("/") || self.path.hasPrefix("ws://") || self.path.hasPrefix("wss://") {
if self.path.hasPrefix("/") || self.path.hasPrefix("ws://") || self.path.hasPrefix("wss://")
{
uri = self.path
} else {
uri = "/" + self.path
Expand Down
2 changes: 1 addition & 1 deletion Sources/Nats/NatsConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class ConnectionHandler: ChannelInboundHandler {
host: server.host ?? "localhost",
path: server.path,
query: server.query,
headers: HTTPHeaders(), // TODO (mtmk): pass in from client options
headers: HTTPHeaders(), // TODO (mtmk): pass in from client options
upgradePromise: upgradePromise)
let httpUpgradeRequestHandlerBox = NIOLoopBound(
httpUpgradeRequestHandler, eventLoop: channel.eventLoop)
Expand Down

0 comments on commit ca1eb11

Please sign in to comment.