Browse files

Allow symbol Header name for HTTP request

Make test pass on 1.8 rubies.
  • Loading branch information...
1 parent b79b2b9 commit 2739f8d9c7a511f942ac88555b2e1e8500fd6c3e @nahi committed May 6, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/httpclient.rb
  2. +1 −1 lib/httpclient/session.rb
View
2 lib/httpclient.rb
@@ -996,7 +996,7 @@ def create_request(method, uri, query, body, header)
end
req = HTTP::Message.new_request(method, uri, query, body, boundary)
header.each do |key, value|
- req.header.add(key, value)
+ req.header.add(key.to_s, value)
end
if @cookie_manager && cookie = @cookie_manager.find(uri)
req.header.add('Cookie', cookie)
View
2 lib/httpclient/session.rb
@@ -813,7 +813,7 @@ def connect_ssl_proxy(socket, uri)
parse_header
res.http_version, res.status, res.reason = @version, @status, @reason
@headers.each do |key, value|
- res.header.set(key, value)
+ res.header.set(key.to_s, value)
end
commands = @client.request_filter.collect { |filter|
filter.filter_response(req, res)

0 comments on commit 2739f8d

Please sign in to comment.