diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_negotiation.rb | 10 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_type.rb | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_negotiation.rb b/actionpack/lib/action_dispatch/http/mime_negotiation.rb index 41e6727315..346598b6de 100644 --- a/actionpack/lib/action_dispatch/http/mime_negotiation.rb +++ b/actionpack/lib/action_dispatch/http/mime_negotiation.rb @@ -66,15 +66,15 @@ module ActionDispatch end end - # Sets the \variant for template + # Sets the \variant for template. def variant=(variant) if variant.is_a? Symbol @variant = variant else - raise ArgumentError, "request.variant must be set to a Symbol, not a #{variant.class}. For security reasons," + - "never directly set the variant to a user-provided value, like params[:variant].to_sym." + - "Check user-provided value against a whitelist first, then set the variant:"+ - "request.variant = :tablet if params[:some_param] == 'tablet'" + raise ArgumentError, "request.variant must be set to a Symbol, not a #{variant.class}. " \ + "For security reasons, never directly set the variant to a user-provided value, " \ + "like params[:variant].to_sym. Check user-provided value against a whitelist first, " \ + "then set the variant: request.variant = :tablet if params[:variant] == 'tablet'" end end diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index a398919ca7..2a8ff0a5d2 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -299,9 +299,7 @@ module Mime true end - def ref - nil - end + def ref; end def respond_to_missing?(method, include_private = false) method.to_s.ends_with? '?' |