test(storage): cover chunked limits and preserve fault cleanup
This commit is contained in:
@@ -179,3 +179,16 @@ def test_pixel_limit_before_decode(client, actors, chat):
|
||||
assert len(stream.getvalue()) < 10 * 1024 * 1024
|
||||
r = upload(client, actors[0], chat, data=stream.getvalue())
|
||||
assert r.status_code == 413
|
||||
|
||||
|
||||
def test_chunked_body_limit_without_content_length(client, actors, chat):
|
||||
r = client.post(
|
||||
f"/api/v1/chats/{chat['id']}/attachments",
|
||||
headers={**headers(actors[0]), "Content-Type": "image/png"},
|
||||
params={"filename": "chunked.png"},
|
||||
content=iter([b"x" * (10 * 1024 * 1024 + 1)]),
|
||||
)
|
||||
assert r.request.headers.get("content-length") is None
|
||||
assert r.status_code == 413
|
||||
assert r.json()["error"]["code"] == "payload_too_large"
|
||||
assert r.json()["error"]["request_id"] == r.headers["x-request-id"]
|
||||
|
||||
Reference in New Issue
Block a user