github vapor/vapor 4.0.0-beta.2.1
Vapor 4.0.0 Beta 2.1

latest releases: 4.106.3, 4.106.2, 4.106.1...
pre-release4 years ago
  • Access to shared HTTPClient is now available via app.client.http (#2120)

  • HTTPClient.Configuration can now be modified via app.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)
  • app.http has been removed. Each component is now separate (#2120)

  • New app.locks helper for managing synchronization of app extensions (#2120)

  • app.storage now supports registering an onShutdown closure that will run when the app shuts down (#2120)

Don't miss a new vapor release

NewReleases is sending notifications on new releases.