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

fix URI.escape is obsolete #383 #393

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
3 changes: 2 additions & 1 deletion ghi
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,8 @@ module GHI
def request method, path, options
path = "/api/v3#{path}" if HOST != DEFAULT_HOST

path = URI.escape path
parser = URI::Parser.new
path = parser.escape(path)
if params = options[:params] and !params.empty?
q = params.map { |k, v| "#{CGI.escape k.to_s}=#{CGI.escape v.to_s}" }
path += "?#{q.join '&'}"
Expand Down
3 changes: 2 additions & 1 deletion lib/ghi/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def delete path, options = {}
def request method, path, options
path = "/api/v3#{path}" if HOST != DEFAULT_HOST

path = URI.escape path
parser = URI::Parser.new
path = parser.escape(path)
if params = options[:params] and !params.empty?
q = params.map { |k, v| "#{CGI.escape k.to_s}=#{CGI.escape v.to_s}" }
path += "?#{q.join '&'}"
Expand Down