1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Drop Ruby 1.8 checks

This commit is contained in:
Olle Jonsson 2019-04-12 23:17:19 +02:00
parent 1115703b7c
commit 0df3f3c115

View file

@ -24,16 +24,14 @@ describe Rack::Protection::PathTraversal do
end
end
if "".respond_to?(:encoding) # Ruby 1.9+ M17N
context "PATH_INFO's encoding" do
before do
@app = Rack::Protection::PathTraversal.new(proc { |e| [200, {'Content-Type' => 'text/plain'}, [e['PATH_INFO'].encoding.to_s]] })
end
context "PATH_INFO's encoding" do
before do
@app = Rack::Protection::PathTraversal.new(proc { |e| [200, {'Content-Type' => 'text/plain'}, [e['PATH_INFO'].encoding.to_s]] })
end
it 'should remain unchanged as ASCII-8BIT' do
body = @app.call({ 'PATH_INFO' => '/'.encode('ASCII-8BIT') })[2][0]
expect(body).to eq('ASCII-8BIT')
end
it 'should remain unchanged as ASCII-8BIT' do
body = @app.call({ 'PATH_INFO' => '/'.encode('ASCII-8BIT') })[2][0]
expect(body).to eq('ASCII-8BIT')
end
end
end