Created
March 27, 2011 00:45
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
response = Net::HTTP.new('localhost', 4567).send_request('GET', '/') | |
puts response.get_fields('Set-Cookie').inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby client.rb | |
["foo", "bar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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