Skip to content

Commit

Permalink
[api] Send Content-Disposition: inline for text files
Browse files Browse the repository at this point in the history
Without this fix, text files such as _log are served with
`Content-Disposition: attachment`, which makes Firefox prompt the user to
download the file rather than simply showing the text within the browser.
  • Loading branch information
poiru authored and coolo committed Jan 11, 2015
1 parent 5e462ae commit acda5a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/app/controllers/application_controller.rb
Expand Up @@ -374,6 +374,7 @@ def volley_backend_path(path)
end
end
opts[:length] = @volleyfile.length
opts[:disposition] = 'inline' if opts[:type] == 'text/plain'
# streaming makes it very hard for test cases to verify output
opts[:stream] = false if Rails.env.test?
send_file(@volleyfile.path, opts)
Expand Down

0 comments on commit acda5a4

Please sign in to comment.