1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

fix on val.to_s CGI::unescape only accepts strings, sometimes a value needs to be to_s like on the params collect above.

This commit is contained in:
Dan Mayer 2011-09-19 20:18:42 -04:00
parent 6a4ac722a1
commit b1e7233bde

View file

@ -87,7 +87,7 @@ module RestClient
def make_headers user_headers
unless @cookies.empty?
user_headers[:cookie] = @cookies.map { |(key, val)| "#{key.to_s}=#{CGI::unescape(val)}" }.sort.join('; ')
user_headers[:cookie] = @cookies.map { |(key, val)| "#{key.to_s}=#{CGI::unescape(val.to_s)}" }.sort.join('; ')
end
headers = stringify_headers(default_headers).merge(stringify_headers(user_headers))
headers.merge!(@payload.headers) if @payload