Skip to content

Commit

Permalink
Merge pull request #1839 from ably/fix/1796-test__090__RestClient-fix
Browse files Browse the repository at this point in the history
Fix for "test__090__RestClient__request_…"
  • Loading branch information
maratal authored Dec 14, 2023
2 parents df914e1 + 5388512 commit dee121a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Source/ARTRest.m
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ - (BOOL)request:(NSString *)method
}

NSURL *url = [NSURL URLWithString:path relativeToURL:self.baseUrl];
// Should not happen in iOS 17 and above. See explanation in the "Important" section here:
// https://developer.apple.com/documentation/foundation/nsurl/1572047-urlwithstring
if (!url) {
if (errorPtr) {
*errorPtr = [NSError errorWithDomain:ARTAblyErrorDomain
Expand Down
9 changes: 0 additions & 9 deletions Test/Tests/RestClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1911,15 +1911,6 @@ class RestClientTests: XCTestCase {
let mockHTTPExecutor = MockHTTPExecutor()
rest.internal.httpExecutor = mockHTTPExecutor

do {
try rest.request("get", path: "new feature", params: nil, body: nil, headers: nil) { _, _ in
fail("Completion closure should not be called")
}
} catch let error as NSError {
XCTAssertEqual(error.code, ARTCustomRequestError.invalidPath.rawValue)
expect(error.localizedDescription).to(contain("Path isn't valid"))
}

do {
try rest.request("get", path: "", params: nil, body: nil, headers: nil) { _, _ in
fail("Completion closure should not be called")
Expand Down

0 comments on commit dee121a

Please sign in to comment.