fix(service): validate image data with bounded decoding

This commit is contained in:
kk10
2026-11-06 15:35:14 +03:00
parent 8d6fd066df
commit a11463c680
5 changed files with 56 additions and 32 deletions
+14 -14
View File
@@ -1,17 +1,17 @@
> make load-go LOAD_WORKERS=10 LOAD_DURATION=30s
go test -count=1 -tags=load ./student-tests/... -v -args -base-url=http://localhost:8080 -workers=10 -duration=30s
=== RUN TestConcurrentUploads
attachment_load_test.go:141: workers=10 duration=30.0s elapsed=30.3s
attachment_load_test.go:142: total uploads=5096 transport_errors=0
attachment_load_test.go:144: HTTP 201: 5096
attachment_load_test.go:148: successful RPS: 168.33
attachment_load_test.go:152: latency p50=55.701325ms p95=99.180675ms p99=137.654783ms
attachment_load_test.go:141: workers=10 duration=30.0s elapsed=30.4s
attachment_load_test.go:142: total uploads=632 transport_errors=0
attachment_load_test.go:144: HTTP 201: 632
attachment_load_test.go:148: successful RPS: 20.82
attachment_load_test.go:152: latency p50=449.961ms p95=691.7505ms p99=807.8037ms
attachment_load_test.go:176: memory per container (idle -> peak):
attachment_load_test.go:178: mtusi2026lab4-api-1: 13.0MiB -> 15.5MiB
attachment_load_test.go:178: mtusi2026lab4-api-2: 13.0MiB -> 16.4MiB
--- PASS: TestConcurrentUploads (32.60s)
attachment_load_test.go:178: mtusi2026lab4-api-1: 12.2MiB -> 50.9MiB
attachment_load_test.go:178: mtusi2026lab4-api-2: 13.3MiB -> 56.7MiB
--- PASS: TestConcurrentUploads (32.69s)
=== RUN TestLoad
load_test.go:109: duration: 30.001s
load_test.go:109: duration: 30.000s
load_test.go:110: workers: 10
load_test.go:111: rate per worker: 20 req/s
load_test.go:112: target rate: 200 req/s
@@ -19,9 +19,9 @@ go test -count=1 -tags=load ./student-tests/... -v -args -base-url=http://localh
load_test.go:116: HTTP 201: 5990
load_test.go:119: request errors: 0
load_test.go:123: successful RPS: 199.66
load_test.go:132: successful latency p50: 8.402766ms
load_test.go:133: successful latency p95: 11.110029ms
load_test.go:134: successful latency p99: 14.64398ms
--- PASS: TestLoad (30.37s)
load_test.go:132: successful latency p50: 8.1287ms
load_test.go:133: successful latency p95: 9.4585ms
load_test.go:134: successful latency p99: 16.4092ms
--- PASS: TestLoad (30.58s)
PASS
ok mtusi2026-messenger/student-tests 62.967s
ok mtusi2026-messenger/student-tests 63.302s