Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Changes escape method to support ruby 3 #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/clever-ruby/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,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)
Addressable::URI.parse(@config.base_url + path).normalize.to_s
end

# Builds the HTTP request body
Expand Down
2 changes: 1 addition & 1 deletion lib/clever-ruby/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def base_path=(base_path)

def base_url
url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
URI.encode(url)
Addressable::URI.parse(url).normalize.to_s
end

# Gets API key (with prefix if set).
Expand Down
2 changes: 1 addition & 1 deletion override/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,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)
Addressable::URI.parse(@config.base_url + path).normalize.to_s
end

# Builds the HTTP request body
Expand Down