Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public struct AsyncHTTPClientTransport: ClientTransport {
guard var baseUrlComponents = URLComponents(string: baseURL.absoluteString) else {
throw Error.invalidRequestURL(request: request, baseURL: baseURL)
}
baseUrlComponents.path += request.path
baseUrlComponents.percentEncodedPath += request.path
baseUrlComponents.percentEncodedQuery = request.query
guard let url = baseUrlComponents.url else {
throw Error.invalidRequestURL(request: request, baseURL: baseURL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Test_AsyncHTTPClientTransport: XCTestCase {

func testConvertRequest() throws {
let request: OpenAPIRuntime.Request = .init(
path: "/hello/Maria",
path: "/hello%20world/Maria",
query: "greeting=Howdy",
method: .post,
headerFields: [
Expand All @@ -50,7 +50,7 @@ class Test_AsyncHTTPClientTransport: XCTestCase {
request,
baseURL: try XCTUnwrap(URL(string: "http://example.com/api/v1"))
)
XCTAssertEqual(httpRequest.url, "http://example.com/api/v1/hello/Maria?greeting=Howdy")
XCTAssertEqual(httpRequest.url, "http://example.com/api/v1/hello%20world/Maria?greeting=Howdy")
XCTAssertEqual(httpRequest.method, .POST)
XCTAssertEqual(
httpRequest.headers,
Expand Down