Merge pull request #506 from ParkedHampster/filename_extension

Bug: Filename Length
This commit is contained in:
Kyle Drake 2024-07-17 17:05:59 -05:00 committed by GitHub
commit bd3909c7d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -123,7 +123,7 @@ post '/api/upload' do
end
if SiteFile.name_too_long? file[:filename]
api_error 400, 'file_name_too_long', "#{file[:filename]} filename is too long"
api_error 400, 'file_name_too_long', "#{file[:filename]} filename is too long (exceeds 255 characters)"
end
end

View file

@ -6,7 +6,7 @@ class SiteFile < Sequel::Model
CLASSIFIER_LIMIT = 1_000_000
CLASSIFIER_WORD_LIMIT = 25
FILE_PATH_CHARACTER_LIMIT = 1200
FILE_NAME_CHARACTER_LIMIT = 100
FILE_NAME_CHARACTER_LIMIT = 255
unrestrict_primary_key
plugin :update_primary_key
many_to_one :site