diff --git a/Sources/HTTPWebDriver.swift b/Sources/HTTPWebDriver.swift index f0091e2..68fd22b 100644 --- a/Sources/HTTPWebDriver.swift +++ b/Sources/HTTPWebDriver.swift @@ -13,8 +13,8 @@ public struct HTTPWebDriver: WebDriver { // Send a WebDriverRequest to the web driver local service // TODO: consider making this function async/awaitable @discardableResult - public func send(_ request: Request) throws -> Request.Response where Request: WebDriverRequest { - let urlRequest = Self.buildURLRequest(request) + public func send(_ request: Request) throws -> Request.Response { + let urlRequest = try buildURLRequest(request) // Send the request and decode result or error let (status, responseData) = try urlRequest.send() @@ -24,7 +24,7 @@ public struct HTTPWebDriver: WebDriver { return try JSONDecoder().decode(Request.Response.self, from: responseData) } - private static func buildURLRequest(_ request: Request) throws -> URLRequest { + private func buildURLRequest(_ request: Request) throws -> URLRequest { var url = rootURL for pathComponent in request.pathComponents { url.appendPathComponent(pathComponent) diff --git a/Sources/WebDriverRequest.swift b/Sources/WebDriverRequest.swift index 9ea0199..ca051b6 100644 --- a/Sources/WebDriverRequest.swift +++ b/Sources/WebDriverRequest.swift @@ -13,7 +13,7 @@ public protocol WebDriverRequest { var body: Body { get } } -extension WebDriverRequest where ResponseValue = CodableNone { +extension WebDriverRequest where Body == CodableNone { var body: Body { .init() } }