Skip to content

Commit 14a3a63

Browse files
committed
Renabled ssl in redirect tests
1 parent c461c58 commit 14a3a63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/AsyncHTTPClientTests/HTTPClientTests.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ class HTTPClientTests: XCTestCase {
728728
}
729729

730730
func testLoopDetectionRedirectLimit() throws {
731-
let httpBin = HTTPBin()
731+
let httpBin = HTTPBin(ssl: true)
732732
let httpClient = HTTPClient(eventLoopGroupProvider: .shared(self.clientGroup),
733733
configuration: HTTPClient.Configuration(certificateVerification: .none, redirectConfiguration: .follow(max: 5, allowCycles: false)))
734734

@@ -737,13 +737,13 @@ class HTTPClientTests: XCTestCase {
737737
XCTAssertNoThrow(try httpBin.shutdown())
738738
}
739739

740-
XCTAssertThrowsError(try httpClient.get(url: "http://localhost:\(httpBin.port)/redirect/infinite1").wait(), "Should fail with redirect limit") { error in
740+
XCTAssertThrowsError(try httpClient.get(url: "https://localhost:\(httpBin.port)/redirect/infinite1").wait(), "Should fail with redirect limit") { error in
741741
XCTAssertEqual(error as? HTTPClientError, HTTPClientError.redirectCycleDetected)
742742
}
743743
}
744744

745745
func testCountRedirectLimit() throws {
746-
let httpBin = HTTPBin()
746+
let httpBin = HTTPBin(ssl: true)
747747
let httpClient = HTTPClient(eventLoopGroupProvider: .shared(self.clientGroup),
748748
configuration: HTTPClient.Configuration(certificateVerification: .none, redirectConfiguration: .follow(max: 1000, allowCycles: true)))
749749

@@ -752,7 +752,7 @@ class HTTPClientTests: XCTestCase {
752752
XCTAssertNoThrow(try httpBin.shutdown())
753753
}
754754

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

0 commit comments

Comments
 (0)