Change file size limit to 512 KiB.

This commit is contained in:
tastytea 2020-11-15 21:30:19 +01:00
parent e1683b889e
commit 6b37d22327
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 3 additions and 3 deletions

View File

@ -70,13 +70,13 @@ entry_type parse_formdata()
for (const auto &screenshot : cgi.getFiles())
{
constexpr size_t size_limit{1024 * 1024 * 1};
constexpr size_t size_limit{1024 * 512};
if (screenshot.getDataLength() > size_limit)
{
throw runtime_error{format("The screenshot “{0:s}” is too big. "
"The limit is {1:.1f} MiB.",
"The limit is {1:.1f} kilobyte (KiB).",
screenshot.getFilename(),
size_limit / 1024.0 / 1024)};
size_limit / 1024.0)};
}
const string filepath{files::get_tmpdir() / screenshot.getFilename()};