Skip to content

Commit 4a1ff5d

Browse files
committed
Renabled ssl in redirect tests
1 parent eeea672 commit 4a1ff5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/AsyncHTTPClientTests/HTTPClientTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ class HTTPClientTests: XCTestCase {
740740
}
741741

742742
func testLoopDetectionRedirectLimit() throws {
743-
let httpBin = HTTPBin()
743+
let httpBin = HTTPBin(ssl: true)
744744
let httpClient = HTTPClient(eventLoopGroupProvider: .shared(self.clientGroup),
745745
configuration: HTTPClient.Configuration(certificateVerification: .none, redirectConfiguration: .follow(max: 5, allowCycles: false)))
746746

@@ -749,13 +749,13 @@ class HTTPClientTests: XCTestCase {
749749
XCTAssertNoThrow(try httpBin.shutdown())
750750
}
751751

752-
XCTAssertThrowsError(try httpClient.get(url: "http://localhost:\(httpBin.port)/redirect/infinite1").wait(), "Should fail with redirect limit") { error in
752+
XCTAssertThrowsError(try httpClient.get(url: "https://localhost:\(httpBin.port)/redirect/infinite1").wait(), "Should fail with redirect limit") { error in
753753
XCTAssertEqual(error as? HTTPClientError, HTTPClientError.redirectCycleDetected)
754754
}
755755
}
756756

757757
func testCountRedirectLimit() throws {
758-
let httpBin = HTTPBin()
758+
let httpBin = HTTPBin(ssl: true)
759759
let httpClient = HTTPClient(eventLoopGroupProvider: .shared(self.clientGroup),
760760
configuration: HTTPClient.Configuration(certificateVerification: .none, redirectConfiguration: .follow(max: 1000, allowCycles: true)))
761761

@@ -764,7 +764,7 @@ class HTTPClientTests: XCTestCase {
764764
XCTAssertNoThrow(try httpBin.shutdown())
765765
}
766766

767-
XCTAssertThrowsError(try httpClient.get(url: "http://localhost:\(httpBin.port)/redirect/infinite1").wait(), "Should fail with redirect limit") { error in
767+
XCTAssertThrowsError(try httpClient.get(url: "https://localhost:\(httpBin.port)/redirect/infinite1").wait(), "Should fail with redirect limit") { error in
768768
XCTAssertEqual(error as? HTTPClientError, HTTPClientError.redirectLimitReached)
769769
}
770770
}

0 commit comments

Comments
 (0)