diff --git a/lib/swagger_client/api_client.rb b/lib/swagger_client/api_client.rb index cef69c5..87ab21d 100755 --- a/lib/swagger_client/api_client.rb +++ b/lib/swagger_client/api_client.rb @@ -262,7 +262,7 @@ def sanitize_filename(filename) def build_request_url(path) # Add leading and trailing slashes to path path = "/#{path}".gsub(/\/+/, '/') - URI.encode(@config.base_url + path) + URI::DEFAULT_PARSER.escape(@config.base_url + path) end # Builds the HTTP request body diff --git a/lib/swagger_client/configuration.rb b/lib/swagger_client/configuration.rb index 67a619d..300c245 100755 --- a/lib/swagger_client/configuration.rb +++ b/lib/swagger_client/configuration.rb @@ -180,7 +180,7 @@ def base_path=(base_path) def base_url url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - URI.encode(url) + URI::DEFAULT_PARSER.escape(url) end # Gets API key (with prefix if set).