diff options
| author | Aaron Patterson <aaron.patterson@gmail.com> | 2016-12-21 11:21:01 -0800 |
|---|---|---|
| committer | Aaron Patterson <aaron.patterson@gmail.com> | 2016-12-21 12:04:00 -0800 |
| commit | 2eb0a6630ac3ace528de04b308d0250ac613a318 (patch) | |
| tree | 4331d5dfc64ca893faa61718f9a994d065654ca0 /actionpack/lib/action_dispatch/request | |
| parent | 85b2a3ea2f4b614c1b7135e28b86e14fc109e8e5 (diff) | |
| download | rails-2eb0a6630ac3ace528de04b308d0250ac613a318.tar.gz rails-2eb0a6630ac3ace528de04b308d0250ac613a318.tar.bz2 rails-2eb0a6630ac3ace528de04b308d0250ac613a318.zip | |
Document and update API for `skip_parameter_encoding`
This commit changes `parameter_encoding` to `skip_parameter_encoding`.
`skip_parameter_encoding` will set encoding on all parameters to
ASCII-8BIT for a given action on a particular controller. This allows
the controller to handle data when the encoding of that data is unknown,
for example file systems or truly binary parameters.
Diffstat (limited to 'actionpack/lib/action_dispatch/request')
| -rw-r--r-- | actionpack/lib/action_dispatch/request/utils.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/request/utils.rb b/actionpack/lib/action_dispatch/request/utils.rb index 282bdbd2be..01bc871e5f 100644 --- a/actionpack/lib/action_dispatch/request/utils.rb +++ b/actionpack/lib/action_dispatch/request/utils.rb @@ -4,6 +4,17 @@ module ActionDispatch mattr_accessor :perform_deep_munge self.perform_deep_munge = true + def self.each_param_value(params, &block) + case params + when Array + params.each { |element| each_param_value(element, &block) } + when Hash + params.each_value { |value| each_param_value(value, &block) } + when String + block.call params + end + end + def self.normalize_encode_params(params) if perform_deep_munge NoNilParamEncoder.normalize_encode_params params |
