Created
August 1, 2013 14:06
-
-
Save fidothe/6131677 to your computer and use it in GitHub Desktop.
Inchworms weirdness
This file contains hidden or 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/base' | |
require 'rack/test' | |
class Silly | |
include Rack::Test::Methods | |
def app | |
Sinatra.new do | |
get '/', provides: :xml do | |
p env | |
env['HTTP_ACCEPT'].to_s | |
end | |
end | |
end | |
def check | |
p get '/', {'HTTP_ACCEPT' => 'application/xml'} | |
end | |
end | |
r = Silly.new.check | |
p r.body | |
p r['Content-Type'] |
This file contains hidden or 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/base' | |
require 'rack/test' | |
class Silly | |
include Rack::Test::Methods | |
def app | |
Sinatra.new do | |
get '/', provides: :xml do | |
p env | |
env['HTTP_ACCEPT'].to_s | |
end | |
end | |
end | |
def check | |
p get '/', {}, {'HTTP_ACCEPT' => 'application/xml'} | |
end | |
end | |
r = Silly.new.check | |
p r.body | |
p r['Content-Type'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment