Sha256: a8ff1edfe4f88ad16b0a4717d8643e654e25998c97f6dcb66e5be22adbb220b4

Contents?: true

Size: 575 Bytes

Versions: 74

Compression:

Stored size: 575 Bytes

Contents

# frozen_string_literal: true

module ActiveStorage::FileServer # :nodoc:
  private
    def serve_file(path, content_type:, disposition:)
      Rack::File.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["Content-Type"] = content_type || DEFAULT_SEND_FILE_TYPE
        response.headers["Content-Disposition"] = disposition || DEFAULT_SEND_FILE_DISPOSITION
      end
    end
end

Version data entries

74 entries across 70 versions & 6 rubygems

Version Path
activestorage-7.0.8.6 app/controllers/concerns/active_storage/file_server.rb
activestorage-6.1.7.10 app/controllers/concerns/active_storage/file_server.rb
activestorage-6.1.7.9 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.0.8.5 app/controllers/concerns/active_storage/file_server.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activestorage-7.0.8.4/app/controllers/concerns/active_storage/file_server.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activestorage-7.0.5.1/app/controllers/concerns/active_storage/file_server.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activestorage-7.0.5.1/app/controllers/concerns/active_storage/file_server.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activestorage-7.0.5.1/app/controllers/concerns/active_storage/file_server.rb
activestorage-7.0.8.4 app/controllers/concerns/active_storage/file_server.rb
activestorage-6.1.7.8 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.0.8.1 app/controllers/concerns/active_storage/file_server.rb
activestorage-6.1.7.7 app/controllers/concerns/active_storage/file_server.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activestorage-7.0.3.1/app/controllers/concerns/active_storage/file_server.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activestorage-7.0.2.3/app/controllers/concerns/active_storage/file_server.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activestorage-6.1.6.1/app/controllers/concerns/active_storage/file_server.rb
activestorage-7.0.8 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.0.7.2 app/controllers/concerns/active_storage/file_server.rb
activestorage-6.1.7.6 app/controllers/concerns/active_storage/file_server.rb
activestorage-7.0.7.1 app/controllers/concerns/active_storage/file_server.rb
activestorage-6.1.7.5 app/controllers/concerns/active_storage/file_server.rb