mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
parent
318b1a5462
commit
e32893491b
2 changed files with 7 additions and 1 deletions
|
@ -829,7 +829,7 @@ module Sinatra
|
|||
|
||||
if values.any?
|
||||
original, @params = params, params.merge('splat' => [], 'captures' => values)
|
||||
keys.zip(values) { |k,v| (@params[k] ||= '') << v if v }
|
||||
keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
|
||||
end
|
||||
|
||||
catch(:pass) do
|
||||
|
|
|
@ -236,6 +236,12 @@ class RoutingTest < Test::Unit::TestCase
|
|||
assert_equal "format=", body
|
||||
end
|
||||
|
||||
it 'does not concatinate params with the same name' do
|
||||
mock_app { get('/:foo') { params[:foo] } }
|
||||
get '/a?foo=b'
|
||||
assert_body 'a'
|
||||
end
|
||||
|
||||
it "supports single splat params like /*" do
|
||||
mock_app {
|
||||
get '/*' do
|
||||
|
|
Loading…
Reference in a new issue