From b1e7233bde9cf9afd872899a0c1cd65eca275660 Mon Sep 17 00:00:00 2001 From: Dan Mayer Date: Mon, 19 Sep 2011 20:18:42 -0400 Subject: [PATCH] fix on val.to_s CGI::unescape only accepts strings, sometimes a value needs to be to_s like on the params collect above. --- lib/restclient/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/restclient/request.rb b/lib/restclient/request.rb index 766831b..6841d2e 100644 --- a/lib/restclient/request.rb +++ b/lib/restclient/request.rb @@ -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