fix: address attachments verify findings
- keep one upload body in memory: BytesIO + getvalue() without copy, fixed glibc mmap threshold in the image (no realloc copy on growth) - stop PNG inflate at expected size + 1 byte - reject filename that is not valid UTF-8 after percent-decoding (400) - failure stand: env limit variables do not change attachment limits; history with attachment_ids while S3 is stopped - drop dead constants; restate "old image on new schema" scenario Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,7 @@ DOMAIN_ERRORS: dict[type[exceptions.DomainError], tuple[int, ErrorCode]] = {
|
||||
exceptions.AttachmentNotFound: (404, ErrorCode.NOT_FOUND),
|
||||
exceptions.InvalidChatMembers: (400, ErrorCode.INVALID_REQUEST),
|
||||
exceptions.InvalidCursor: (400, ErrorCode.INVALID_REQUEST),
|
||||
exceptions.InvalidFilename: (400, ErrorCode.INVALID_REQUEST),
|
||||
exceptions.UploadInterrupted: (400, ErrorCode.INVALID_REQUEST),
|
||||
exceptions.PayloadTooLarge: (413, ErrorCode.PAYLOAD_TOO_LARGE),
|
||||
exceptions.UnsupportedMediaType: (
|
||||
|
||||
Reference in New Issue
Block a user