# Skip before, after, and around action callbacks matching any of the names.
#
# ==== Parameters
# * <tt>names</tt> - A list of valid names that could be used for
# callbacks. Note that skipping uses Ruby equality, so it's
# impossible to skip a callback defined using an anonymous proc
# using #skip_action_callback.
defskip_action_callback(*names)
ActiveSupport::Deprecation.warn("`skip_action_callback` is deprecated and will be removed in Rails 5.1. Please use skip_before_action, skip_after_action or skip_around_action instead.")
skip_before_action(*names,raise: false)
skip_after_action(*names,raise: false)
skip_around_action(*names,raise: false)
end
defskip_filter(*names)
ActiveSupport::Deprecation.warn("`skip_filter` is deprecated and will be removed in Rails 5.1. Use skip_before_action, skip_after_action or skip_around_action instead.")
skip_action_callback(*names)
end
# Take callback names and an optional callback proc, normalize them,
# then call the block with each callback. This allows us to abstract
# the normalization across several methods that use it.
ActiveSupport::Deprecation.warn("`:nothing` option is deprecated and will be removed in Rails 5.1. Use `head` method to respond with empty response body.")
# ActionDispatch::ParamsParser works for all the requests having any Content-Length
# (like POST). It takes raw data from the request and puts it through the parser
# that is picked based on Content-Type header.
#
# In case of any error while parsing data ParamsParser::ParseError is raised.
classParamsParser
# Raised when raw data from the request cannot be parsed by the parser
# defined for request's content mime type.
classParseError<StandardError
definitialize(message=nil,original_exception=nil)
ifmessage
ActiveSupport::Deprecation.warn("Passing #message is deprecated and has no effect. "\
"#{self.class} will automatically capture the message "\
"of the original exception.",caller)
end
iforiginal_exception
ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. "\
"Exceptions will automatically capture the original exception.",caller)
end
super($!.message)
end
deforiginal_exception
ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.",caller)
cause
end
end
# Create a new +ParamsParser+ middleware instance.
#
# The +parsers+ argument can take Hash of parsers where key is identifying
# content mime type, and value is a lambda that is going to process data.
defself.new(app,parsers={})
ActiveSupport::Deprecation.warn("ActionDispatch::ParamsParser is deprecated and will be removed in Rails 5.1. Configure the parameter parsing in ActionDispatch::Request.parameter_parsers.")
# Follow a single redirect response. If the last response was not a
# redirect, an exception will be raised. Otherwise, the redirect is
# performed on the location header.
...
...
@@ -112,59 +80,6 @@ def follow_redirect!
get(response.location)
status
end
# Performs a request using the specified method, following any subsequent
# redirect. Note that the redirects are followed until the response is
# not a redirect--this means you may run into an infinite loop if your
# redirect loops back to itself.
#
# Example:
#
# request_via_redirect :post, '/welcome',
# params: { ref_id: 14 },
# headers: { "X-Test-Header" => "testvalue" }
defrequest_via_redirect(http_method,path,*args)
ActiveSupport::Deprecation.warn("`request_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.")
process_with_kwargs(http_method,path,*args)
follow_redirect!whileredirect?
status
end
# Performs a GET request, following any subsequent redirect.
# See +request_via_redirect+ for more information.
defget_via_redirect(path,*args)
ActiveSupport::Deprecation.warn("`get_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.")
request_via_redirect(:get,path,*args)
end
# Performs a POST request, following any subsequent redirect.
# See +request_via_redirect+ for more information.
defpost_via_redirect(path,*args)
ActiveSupport::Deprecation.warn("`post_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.")
request_via_redirect(:post,path,*args)
end
# Performs a PATCH request, following any subsequent redirect.
# See +request_via_redirect+ for more information.
defpatch_via_redirect(path,*args)
ActiveSupport::Deprecation.warn("`patch_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.")
request_via_redirect(:patch,path,*args)
end
# Performs a PUT request, following any subsequent redirect.
# See +request_via_redirect+ for more information.
defput_via_redirect(path,*args)
ActiveSupport::Deprecation.warn("`put_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.")
request_via_redirect(:put,path,*args)
end
# Performs a DELETE request, following any subsequent redirect.
# See +request_via_redirect+ for more information.
defdelete_via_redirect(path,*args)
ActiveSupport::Deprecation.warn("`delete_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.")
request_via_redirect(:delete,path,*args)
end
end
# An instance of this class represents a set of requests and responses