-
Access to shared
HTTPClient
is now available viaapp.client.http
(#2120) -
HTTPClient.Configuration
can now be modified viaapp.client.configuration
(#2120)
let app = Application(.testing)
defer { app.shutdown() }
app.client.configuration.redirectConfiguration = .disallow
app.get("redirect") {
$0.redirect(to: "foo")
}
let server = try app.server.start(hostname: "localhost", port: 8080)
defer { server.shutdown() }
let res = try app.client.get("http://localhost:8080/redirect").wait()
XCTAssertEqual(res.status, .seeOther)