Important bug fix
No need to percentage encoding base path at the client initialization time, it will be done later in a much more sophisticated way when prepare a request. It’s enough to just attempt to create URL from base path string to do basic validation of the provided base path.
This commit is contained in:
parent
8fbfc92bb0
commit
df824b93d3
|
@ -45,9 +45,7 @@ struct APIClient: APIClientCore
|
|||
) throws
|
||||
{
|
||||
guard
|
||||
let percentEncodedBasePath = basePath.addingPercentEncoding(
|
||||
withAllowedCharacters: .urlPathAllowed
|
||||
)
|
||||
URL(string: basePath) != nil
|
||||
else
|
||||
{
|
||||
throw InvalidBasePath(basePath: basePath)
|
||||
|
@ -55,7 +53,7 @@ struct APIClient: APIClientCore
|
|||
|
||||
//===
|
||||
|
||||
self.basePath = percentEncodedBasePath
|
||||
self.basePath = basePath
|
||||
|
||||
self.session = URLSession(
|
||||
configuration: sessionConfig,
|
||||
|
|
|
@ -92,4 +92,3 @@ extension APIClientCore
|
|||
return result
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue