class Falcon::Adapters::Rewindable
Content type driven input buffering.
def call(request)
-
(Async::HTTP::Response)
- the response.
def call(request) if body = request.body and needs_rewind?(request) request.body = Async::HTTP::Body::Rewindable.new(body) end return super end
def initialize(app)
def initialize(app) super(app) end
def needs_rewind?(request)
def needs_rewind?(request) content_type = request.headers['content-type'] if request.method == POST and content_type.nil? return true end if BUFFERED_MEDIA_TYPES =~ content_type return true end return false end