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:
Maxim Khatskevich 2017-09-18 04:13:59 +05:00
parent 8fbfc92bb0
commit df824b93d3
2 changed files with 2 additions and 5 deletions

View File

@ -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,

View File

@ -92,4 +92,3 @@ extension APIClientCore
return result
}
}