Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created March 27, 2011 00:45
Show Gist options
  • Save myronmarston/888794 to your computer and use it in GitHub Desktop.
Save myronmarston/888794 to your computer and use it in GitHub Desktop.
Demonstration of a bug in Faraday. The adapters all treat a header with multiple values differently.
require 'net/http'
response = Net::HTTP.new('localhost', 4567).send_request('GET', '/')
puts response.get_fields('Set-Cookie').inspect
$ ruby client.rb
["foo", "bar"]
require 'sinatra'
get '/' do
[200, { 'Set-Cookie' => %w[ foo bar ] }, '']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment