mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: add lang.isBinary option
This commit is contained in:
3 files changed
+4
-3
No files matched your search
@@ -483,8 +483,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||
if (!file || file.size === 0) throw new ValidationError('code');
|
||||
const sizeLimit = config.type === 'submit_answer' ? 128 * 1024 * 1024 : lengthLimit;
|
||||
if (file.size > sizeLimit) throw new ValidationError('file');
|
||||
if (file.size < lengthLimit && !file.filepath.endsWith('.zip')) {
|
||||
// TODO auto detect & convert encoding
|
||||
if (file.size < lengthLimit && !file.filepath.endsWith('.zip') && !setting.langs[lang].isBinary) {
|
||||
// TODO submission file shape
|
||||
code = await readFile(file.filepath, 'utf-8');
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user