Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to ignore empty captures from params #1390

Merged
merged 2 commits into from
Feb 21, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix params when http request path mismatching with filter regex
  • Loading branch information
iguchi1124 committed Feb 20, 2018
commit 51fe0fcb00cf8f21c524370a3b7c7a4a4c7d067a
2 changes: 1 addition & 1 deletion lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ def process_route(pattern, conditions, block = nil, values = [])
if regexp_exists
captures = pattern.match(route).captures
values += captures
@params[:captures] = captures
@params[:captures] = captures unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
Expand Down