Reject corrupt PNG pixels with bounded stream validation
This commit is contained in:
@@ -10,7 +10,7 @@ from httpx import AsyncClient, Response
|
||||
from conftest import actor, make_chat, register, resolve, running_app, scalar
|
||||
from fakes import MemoryObjectStorage
|
||||
from messenger.attachments.application.ports import ObjectStorage
|
||||
from pictures import GIF, JPEG, SAMPLE, WEBP, png
|
||||
from pictures import BROKEN_PNG, GIF, JPEG, SAMPLE, WEBP, png
|
||||
|
||||
LIMIT = 10_485_760
|
||||
PNG = {"Content-Type": "image/png"}
|
||||
@@ -181,6 +181,7 @@ async def test_pixel_limit_is_read_from_header(
|
||||
@pytest.mark.parametrize(
|
||||
("content", "header"),
|
||||
[
|
||||
(BROKEN_PNG, "image/png"),
|
||||
(JPEG, "image/png"),
|
||||
(GIF, "image/png"),
|
||||
(WEBP, "image/png"),
|
||||
|
||||
Reference in New Issue
Block a user