lib/grape/middleware/formatter.rb in grape-1.3.3 vs lib/grape/middleware/formatter.rb in grape-1.4.0

- old
+ new

@@ -34,12 +34,12 @@ private def build_formatted_response(status, headers, bodies) headers = ensure_content_type(headers) - if bodies.is_a?(Grape::ServeFile::FileResponse) - Grape::ServeFile::SendfileResponse.new([], status, headers) do |resp| - resp.body = bodies.file + if bodies.is_a?(Grape::ServeStream::StreamResponse) + Grape::ServeStream::SendfileResponse.new([], status, headers) do |resp| + resp.body = bodies.stream end else # Allow content-type to be explicitly overwritten formatter = fetch_formatter(headers, options) bodymap = ActiveSupport::Notifications.instrument('format_response.grape', formatter: formatter, env: env) do