Sha256: cd1bf27582f94262642179eea23df75a73e6dbcd3e60739c862efcd1d3dbb5b4

Contents?: true

Size: 701 Bytes

Versions: 40

Compression:

Stored size: 701 Bytes

Contents

# frozen_string_literal: true

require "active_support/core_ext/hash/except"

module ActiveStorage::FileServer # :nodoc:
  private
    def serve_file(path, content_type:, disposition:)
      ::Rack::Files.new(nil).serving(request, path).tap do |(status, headers, body)|
        self.status = status
        self.response_body = body

        headers.each do |name, value|
          response.headers[name] = value
        end

        response.headers.except!("X-Cascade", "x-cascade") if status == 416
        response.headers["Content-Type"] = content_type || DEFAULT_SEND_FILE_TYPE
        response.headers["Content-Disposition"] = disposition || DEFAULT_SEND_FILE_DISPOSITION
      end
    end
end

Version data entries

40 entries across 40 versions & 5 rubygems

Version Path
activestorage-8.0.2 app/controllers/concerns/active_storage/file_server.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/activestorage-7.1.3.4/app/controllers/concerns/active_storage/file_server.rb
activestorage-8.0.1 app/controllers/concerns/active_storage/file_server.rb
activestorage-8.0.0.1 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.2.2.1 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.1.5.1 app/controllers/concerns/active_storage/file_server.rb
activestorage-8.0.0 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.2.2 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.1.5 app/controllers/concerns/active_storage/file_server.rb
activestorage-8.0.0.rc2 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.2.1.2 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.1.4.2 app/controllers/concerns/active_storage/file_server.rb
activestorage-8.0.0.rc1 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.2.1.1 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.1.4.1 app/controllers/concerns/active_storage/file_server.rb
activestorage-8.0.0.beta1 app/controllers/concerns/active_storage/file_server.rb
omg-activestorage-8.0.0.alpha9 app/controllers/concerns/active_storage/file_server.rb
omg-activestorage-8.0.0.alpha8 app/controllers/concerns/active_storage/file_server.rb
omg-activestorage-8.0.0.alpha7 app/controllers/concerns/active_storage/file_server.rb
omg-activestorage-8.0.0.alpha4 app/controllers/concerns/active_storage/file_server.rb