Module: Iron::BoundedRequestBody

Extended by:
ActiveSupport::Concern
Included in:
Api::BaseController, Oauth::RegistrationsController, Oauth::TokensController
Defined in:
app/controllers/concerns/iron/bounded_request_body.rb

Instance Method Summary collapse

Instance Method Details

#process_actionObject

Action Controller's instrumentation reads the request parameters — fully buffering and parsing the body — before any controller callback runs, so the size guard must wrap process_action itself: a before_action fires too late to stop an oversized body from being buffered into memory.



19
20
21
22
23
24
25
# File 'app/controllers/concerns/iron/bounded_request_body.rb', line 19

def process_action(...)
  if acceptable_request_body?
    super
  else
    head :content_too_large
  end
end