Skip to content

Commit 41ee04e

Browse files
committed
Use relative URL as socket url
1 parent 4932cb5 commit 41ee04e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/AsyncHTTPClient/HTTPClient.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,15 @@ public class HTTPClient {
282282
}
283283

284284
let eventLoopChannel: EventLoopFuture<Channel>
285-
if request.scheme == "file" {
286-
eventLoopChannel = bootstrap.connect(unixDomainSocketPath: request.url.path)
285+
if request.scheme == "file", let baseURL = request.url.baseURL {
286+
eventLoopChannel = bootstrap.connect(unixDomainSocketPath: baseURL.path)
287287
} else {
288288
let address = self.resolveAddress(request: request, proxy: self.configuration.proxy)
289289
eventLoopChannel = bootstrap.connect(host: address.host, port: address.port)
290290
}
291291

292292
eventLoopChannel.map { channel in
293-
task.setChannel(channel)
293+
task.setChannel(channel)
294294
}
295295
.flatMap { channel in
296296
channel.writeAndFlush(request)

0 commit comments

Comments
 (0)