Prevent controller from sending huge zipball

This commit is contained in:
Kyle Drake 2019-02-11 01:32:36 -08:00
parent 0231cca30f
commit e278a1cefe

View file

@ -171,6 +171,12 @@ end
get '/site_files/:username.zip' do |username|
require_login
if current_site.too_big_to_download?
flash[:error] = 'Cannot download site as zip as it is too large (or contains too many files)'
redirect '/dashboard'
end
zipfile_path = current_site.files_zip
content_type 'application/octet-stream'
attachment "neocities-#{current_site.username}.zip"