File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Tests/AsyncHTTPClientTests Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -539,10 +539,14 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
539
539
540
540
let localClient = HTTPClient ( eventLoopGroupProvider: . createNew, configuration: config)
541
541
defer { XCTAssertNoThrow ( try localClient. syncShutdown ( ) ) }
542
- let request = HTTPClientRequest ( url: " https://example.com: \( bin. port) /echo-headers " )
542
+ let request = HTTPClientRequest ( url: " https://example.com: \( bin. port) /echohostheader " )
543
543
let response = await XCTAssertNoThrowWithResult ( try await localClient. execute ( request, deadline: . now( ) + . seconds( 2 ) ) )
544
544
XCTAssertEqual ( response? . status, . ok)
545
545
XCTAssertEqual ( response? . version, . http2)
546
+ var body = try await response? . body. collect ( upTo: 1024 )
547
+ let readableBytes = body? . readableBytes ?? 0
548
+ let responseInfo = try body? . readJSONDecodable ( RequestInfo . self, length: readableBytes)
549
+ XCTAssertEqual ( responseInfo? . data, " example.com \( bin. port == 443 ? " " : " : \( bin. port) " ) " )
546
550
}
547
551
}
548
552
Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ internal final class HTTPBin<RequestHandler: ChannelInboundHandler> where
343
343
)
344
344
345
345
static func http1_1( ssl: Bool , compress: Bool = false ) -> Self {
346
- . http1_1( tlsConfiguration: ssl ? nil : TestTLS . serverConfiguration, compress: compress)
346
+ . http1_1( tlsConfiguration: ssl ? TestTLS . serverConfiguration : nil , compress: compress)
347
347
}
348
348
349
349
// supports request decompression and http response compression
You can’t perform that action at this time.
0 commit comments