Skip to content

Commit

Permalink
fix: Remove extra slash in URL (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziodemaria authored Jan 31, 2024
1 parent b91bcdc commit 1f33e21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/ConfidenceProvider/Http/NetworkClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct RequestResult {

extension NetworkClient {
private func constructURL(base: String, path: String) -> URL? {
let normalisedBase = base.hasSuffix("/") ? base : "\(base)/"
let normalisedBase = base.hasSuffix("/") ? base : "\(base)"
let normalisedPath = path.hasPrefix("/") ? String(path.dropFirst()) : path

return URL(string: "\(normalisedBase)\(normalisedPath)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MockedConfidenceClientURLProtocol: URLProtocol {
}

switch path {
case _ where path.hasSuffix(":resolve"):
case _ where path.hasSuffix("/flags:resolve"):
return resolve()
default:
client?.urlProtocol(self, didFailWithError: NSError(domain: "test", code: URLError.badURL.rawValue))
Expand Down

0 comments on commit 1f33e21

Please sign in to comment.