Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 209d4744b5
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (23 sloc) 0.506 kB
class RedirectContentTypeRemover
def initialize(app)
@app = app
end
def call(env)
remove_content_type_from_redirect(env)
@app.call(env)
end
private
def remove_content_type_from_redirect(env)
if input_blank?(env)
env.delete('CONTENT_TYPE')
end
end
def input_blank?(env)
input = env['rack.input']
return true unless input
content = input.read
input.rewind
content.blank?
end
end
Capybara.app = RedirectContentTypeRemover.new(Capybara.app)
Jump to Line
Something went wrong with that request. Please try again.