mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Prevent controller from sending huge zipball
This commit is contained in:
parent
0231cca30f
commit
e278a1cefe
1 changed files with 6 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue