Created
August 31, 2016 11:43
-
-
Save Tyralion/227ca35b7fbf98547e923e2a4571fb5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActionDispatchPatch | |
module Utils | |
def check_param_encoding(params) | |
case params | |
when Array | |
params.each { |element| check_param_encoding(element) } | |
when Hash | |
params.each_value { |value| check_param_encoding(value) } | |
when String | |
params.try_decode! | |
end | |
end # check_param_encoding | |
end # Utils | |
module Request | |
private | |
def check_method(name) | |
HTTP_METHOD_LOOKUP[name].nil? ? 'GET' : name | |
end # check_method | |
end # Request | |
end # ActionDispatchPatch | |
ActionDispatch::Request::Utils.extend(ActionDispatchPatch::Utils) | |
ActionDispatch::Request.include(ActionDispatchPatch::Request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment