Files
mtusi2026lab6/evidence/test-attachments.txt

19 lines
1.5 KiB
Plaintext

# 2026-11-21T20:04:44Z 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 0.74s
PASS exactly-near limit (~10 MiB) accepted, Content-Length > limit -> 413 0.54s 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.016s, 50 MiB never sent
PASS pixel limit: 8000x6000 header -> 413 without decoding 0.09s 0.092s
PASS decompression bomb: IDAT inflates beyond declared size -> 415 0.32s 65295-byte file claiming 64 MiB raw, rejected in 0.046s
PASS corrupted images -> 415 (truncated, bad CRC, no EOI, garbage, empty) 0.29s 9 variants
PASS MIME spoofing by Content-Type/filename -> 415 0.37s
PASS dangerous/invalid filenames -> 400; filename never becomes a path 0.19s
PASS missing/invalid Content-Length -> 400 (chunked upload is not accepted) 0.00s HTTP/1.1 400 Bad Request
PASS ACL: outsider gets 404 for upload/metadata/content; anonymous 401 0.47s outsider 10 MiB upload rejected in 0.33s
PASS variants (lab5): original/thumbnail/crop/optimized OK after ready, unknown -> 400 0.76s
PASS message: foreign/unknown attachment_id -> 404, file of other chat -> 404, limits -> 400 0.15s
PASS idempotency includes attachment_ids (replay same, conflict on change) 0.19s
summary: 13 passed, 0 failed
exit=0