Skip to content

Commit ef2ee8a

Browse files
committed
added support for vapor 3.0.1
1 parent 315dac7 commit ef2ee8a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let package = Package(
1414
dependencies: [
1515
// Dependencies declare other packages that this package depends on.
1616
// .package(url: /* package url */, from: "1.0.0"),
17-
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0-rc.2.7"),
17+
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.1"),
1818
.package(url: "https://github.com/vapor/jwt.git", from: "3.0.0-rc.2.1.1")
1919
],
2020
targets: [

Sources/Ferno/FernoRequest.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ public class FernoAPIRequest: FernoRequest {
3939

4040
public func delete(req: Request, method: HTTPMethod, path: [String]) throws -> Future<Bool> {
4141
return try self.createRequest(method: method, path: path, query: [], body: "", headers: [:]).flatMap({ request in
42-
return try self.httpClient.respond(to: request).map({ response in
42+
return self.httpClient.send(request).map({ response in
4343
return response.http.status == .ok
4444
})
4545
})
4646
}
4747

4848
public func send<F: Decodable, T: Content>(req: Request, method: HTTPMethod, path: [String], query: [FernoQuery], body: T, headers: HTTPHeaders) throws -> Future<F> {
4949
return try self.createRequest(method: method, path: path, query: query, body: body, headers: headers).flatMap({ (request) in
50-
return try self.httpClient.respond(to: request).flatMap(to: F.self) { response in
50+
return self.httpClient.send(request).flatMap(to: F.self) { response in
5151
guard response.http.status == .ok else { throw FernoError.requestFailed }
5252
return try self.decoder.decode(F.self, from: response.http, maxSize: 65_536, on: req)
5353
}
@@ -56,7 +56,7 @@ public class FernoAPIRequest: FernoRequest {
5656

5757
public func sendMany<F: Decodable, T: Content>(req: Request, method: HTTPMethod, path: [String], query: [FernoQuery], body: T, headers: HTTPHeaders) throws -> Future<[String: F]> {
5858
return try self.createRequest(method: method, path: path, query: query, body: body, headers: headers).flatMap({ (request) in
59-
return try self.httpClient.respond(to: request).flatMap(to: [String: F].self) { response in
59+
return self.httpClient.send(request).flatMap(to: [String: F].self) { response in
6060
guard response.http.status == .ok else { throw FernoError.requestFailed }
6161
return try self.decoder.decode(Snapshot<F>.self, from: response.http, maxSize: 65_536, on: req).map { snapshot in
6262
return snapshot.data
@@ -109,7 +109,7 @@ extension FernoAPIRequest {
109109
try req.content.encode(oauthBody, as: .urlEncodedForm)
110110
req.http.url = URL(string: "https://www.googleapis.com/oauth2/v4/token")!
111111
req.http.method = .POST
112-
return try self.httpClient.respond(to: req).flatMap(to: OAuthResponse.self) { result in
112+
return self.httpClient.send(req).flatMap(to: OAuthResponse.self) { result in
113113
let oauthRes: Future<OAuthResponse> = try result.content.decode(OAuthResponse.self)
114114
return oauthRes
115115
}.map(to: String.self) { resp in

0 commit comments

Comments
 (0)