File tree
Expand file treeCollapse file tree2 files changed
+3
-3
lines changed Sources/OpenAPIAsyncHTTPClient Tests/OpenAPIAsyncHTTPClientTests
Expand file treeCollapse file tree2 files changed
+3
-3
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -161,7 +161,7 @@ public struct AsyncHTTPClientTransport: ClientTransport {
|
161 | 161 | guard var baseUrlComponents = URLComponents(string: baseURL.absoluteString) else {
|
162 | 162 | throw Error.invalidRequestURL(request: request, baseURL: baseURL)
|
163 | 163 | }
|
164 |
| -baseUrlComponents.path += request.path |
| 164 | +baseUrlComponents.percentEncodedPath += request.path |
165 | 165 | baseUrlComponents.percentEncodedQuery = request.query
|
166 | 166 | guard let url = baseUrlComponents.url else {
|
167 | 167 | throw Error.invalidRequestURL(request: request, baseURL: baseURL)
|
|
Original file line number | Diff line number | Diff line change |
---|
@@ -38,7 +38,7 @@ class Test_AsyncHTTPClientTransport: XCTestCase {
|
38 | 38 |
|
39 | 39 | func testConvertRequest() throws {
|
40 | 40 | let request: OpenAPIRuntime.Request = .init(
|
41 |
| -path: "/hello/Maria", |
| 41 | +path: "/hello%20world/Maria", |
42 | 42 | query: "greeting=Howdy",
|
43 | 43 | method: .post,
|
44 | 44 | headerFields: [
|
@@ -50,7 +50,7 @@ class Test_AsyncHTTPClientTransport: XCTestCase {
|
50 | 50 | request,
|
51 | 51 | baseURL: try XCTUnwrap(URL(string: "http://example.com/api/v1"))
|
52 | 52 | )
|
53 |
| -XCTAssertEqual(httpRequest.url, "http://example.com/api/v1/hello/Maria?greeting=Howdy") |
| 53 | +XCTAssertEqual(httpRequest.url, "http://example.com/api/v1/hello%20world/Maria?greeting=Howdy") |
54 | 54 | XCTAssertEqual(httpRequest.method, .POST)
|
55 | 55 | XCTAssertEqual(
|
56 | 56 | httpRequest.headers,
|
|
You can’t perform that action at this time.
0 commit comments