From afddc0409e53731c8f21328e83921fd234b5bf54 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Wed, 27 Feb 2013 19:57:41 +0100 Subject: `format: true` does not override existing format constraints. Closes #9466. Passing `format: true` used to override the constraints: { format: /json/ } with `/.+/`. This patch only sets the format if there is no constraint present. --- actionpack/lib/action_dispatch/routing/mapper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index dba9ccbfa5..b0842e6354 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -129,7 +129,7 @@ module ActionDispatch end if options[:format] == true - @requirements[:format] = /.+/ + @requirements[:format] ||= /.+/ elsif Regexp === options[:format] @requirements[:format] = options[:format] elsif String === options[:format] -- cgit v1.2.3