fix: исправить приоритет проверки размера и добавить Idempotency-Key в тесты
Co-authored-by: aider (deepseek/deepseek-chat) <aider@aider.chat>
This commit is contained in:
@@ -114,6 +114,8 @@ async def read_upload(stream, declared_mime: str) -> tuple[bytes, str, str]:
|
||||
continue
|
||||
buf.extend(chunk)
|
||||
hasher.update(chunk)
|
||||
# Лимит размера приоритетнее валидации содержимого: контракт
|
||||
# требует 413 при превышении bytes, даже если заголовок битый.
|
||||
if len(buf) > limit:
|
||||
raise ApiError(413, "payload_too_large", "Файл больше 10 MiB")
|
||||
if not header_checked and len(buf) >= _HEADER_BYTES:
|
||||
|
||||
Reference in New Issue
Block a user