# 2026-11-21T15:23:48Z commit=n/a host=Linux 6.18.44-fc-v726 x86_64 cpus=2
$ python3 student-tests/test_attachments.py
## attachments (http://127.0.0.1:8080)
PASS valid PNG and JPEG: 202 queued → ready, byte-exact download by other member   1.63s
PASS exactly-near limit (~10 MiB) accepted, Content-Length > limit -> 413   0.67s  10.00 MiB accepted
PASS oversize rejected BEFORE body is read (early 413, socket)        0.02s  HTTP/1.1 413 Content Too Large in 0.015s, 50 MiB never sent
PASS pixel limit: 8000x6000 header -> 413 without decoding            0.08s  0.077s
PASS decompression bomb: IDAT inflates beyond declared size -> 415    0.35s  65295-byte file claiming 64 MiB raw, rejected in 0.081s
PASS corrupted images -> 415 (truncated, bad CRC, no EOI, garbage, empty)   0.18s  9 variants
PASS MIME spoofing by Content-Type/filename -> 415                    0.05s
PASS dangerous/invalid filenames -> 400; filename never becomes a path   0.05s
PASS missing/invalid Content-Length -> 400 (chunked upload is not accepted)   0.01s  HTTP/1.1 400 Bad Request
PASS ACL: outsider gets 404 for upload/metadata/content; anonymous 401   0.41s  outsider 10 MiB upload rejected in 0.37s
PASS variants (lab5): original/thumbnail/crop/optimized OK after ready, unknown -> 400   0.71s
PASS message: foreign/unknown attachment_id -> 404, file of other chat -> 404, limits -> 400   0.13s
PASS idempotency includes attachment_ids (replay same, conflict on change)   0.10s
summary: 13 passed, 0 failed
exit=0
