We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: 3605e665922c3e154e7323c7a03f72e8
Issue Description:
The following test fails with path missing trailing slash
let url = URL(string: "https://someserver.com:8888/some/path/?foo=bar")! XCTAssertEqual(url.path, "/some/path/")
XCTAssertEqual failed: ("/some/path") is not equal to ("/some/path/")
In case someone decides to defend the above issue as 'correct', then please take into account also the following:
let url = URL(string: "https://someserver.com:8888/some/path//?foo=bar")! XCTAssertEqual(url.path, "/some/path//")
XCTAssertEqual failed: ("/some/path/") is not equal to ("/some/path//")
The text was updated successfully, but these errors were encountered:
Comment by Peter Kese (JIRA)
This happened on Linux, btw.
I haven't checked it on Mac.
Sorry, something went wrong.
.path simply removes the last trailing slash:
.path
print(URL(string: "https://someserver.com:8888/some/path?foo=bar")!.path) print(URL(string: "https://someserver.com:8888/some/path/?foo=bar")!.path) print(URL(string: "https://someserver.com:8888/some/path//?foo=bar")!.path) print(URL(string: "https://someserver.com:8888/some/path///?foo=bar")!.path) print(URL(fileURLWithPath: "/path/").path) print(URL(fileURLWithPath: "/path//").path) print(URL(fileURLWithPath: "/path///").path)
gives:
/some/path /some/path /some/path/ /some/path// /path /path/ /path//
The only case this isnt true is if it is the root directory /
/
print(URL(fileURLWithPath: "/").path) print(URL(fileURLWithPath: "//").path) print(URL(fileURLWithPath: "///").path)
/ / //
This is consistent between macOS and Linux versions.
Indeed it does.
The REST API server that my code is calling is expecting these slashes at the ends of paths and is thus returning me HTTP 404s.
No branches or pull requests
Additional Detail from JIRA
md5: 3605e665922c3e154e7323c7a03f72e8
Issue Description:
The following test fails with path missing trailing slash
In case someone decides to defend the above issue as 'correct', then please take into account also the following:
The text was updated successfully, but these errors were encountered: