Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Updated to Vapor 2
Browse files Browse the repository at this point in the history
  • Loading branch information
valen90 committed Apr 26, 2017
1 parent d527d64 commit c4e04ae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 1 addition & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import PackageDescription

let alpha = Version(2,0,0, prereleaseIdentifiers: ["alpha"])

let package = Package(
name: "AWS",
targets: [
Expand All @@ -11,6 +9,6 @@ let package = Package(
Target(name: "VaporS3", dependencies: ["S3"]),
],
dependencies: [
.Package(url: "https://github.com/vapor/vapor.git", alpha),
.Package(url: "https://github.com/vapor/vapor.git", Version(2,0,0, prereleaseIdentifiers: ["beta"])),
]
)
2 changes: 1 addition & 1 deletion Sources/AWSSignatureV4/ErrorParser/ErrorParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension ErrorParser {
let errorBytes = consume(until: .lessThan)

guard let error = ErrorParser.awsGrammar.contains(errorBytes) else {
throw Error.unknownError(errorBytes.string)
throw Error.unknownError(errorBytes.makeString())
}

return error
Expand Down
4 changes: 2 additions & 2 deletions Sources/S3/S3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public struct S3 {
//TODO(Brett): headers & AccessControlList
)

let response = try EngineClient.put(url, headers, Body.data(bytes))
let response = try EngineClient.factory.put(url, headers, Body.data(bytes))
guard response.status == .ok else {
guard let bytes = response.body.bytes else {
throw Error.invalidResponse(response.status)
Expand All @@ -55,7 +55,7 @@ public struct S3 {
let url = generateURL(for: path)
let headers = try signer.sign(path: path)

let response = try EngineClient.get(url, headers)
let response = try EngineClient.factory.get(url, headers)
guard response.status == .ok else {
guard let bytes = response.body.bytes else {
throw Error.invalidResponse(response.status)
Expand Down
6 changes: 4 additions & 2 deletions Sources/VaporS3/Provider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ private let s3StorageKey = "s3-provider:s3"

public final class Provider: Vapor.Provider {
let s3: S3

public static var repositoryName: String = "VaporS3"
/// Initialize the provider with an s3 instance
public init(_ s3: S3) {
self.s3 = s3
Expand Down Expand Up @@ -45,7 +45,9 @@ public final class Provider: Vapor.Provider {
drop.storage[s3StorageKey] = s3
}

public func beforeRun(_ drop: Droplet) throws {}
public func boot(_ config: Config) throws {}

public func beforeRun(_ droplet: Droplet) throws {}
}

extension Droplet {
Expand Down

0 comments on commit c4e04ae

Please sign in to comment.