Docker: фикс прав на /srv/.cache для appuser; X-Trace-Id в раннем 413

This commit is contained in:
2026-10-07 14:27:31 +03:00
parent 7ee49e8c9f
commit 7002c496dc
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -105,12 +105,14 @@ def _register_middleware(app: FastAPI) -> None:
content_length = request.headers.get("Content-Length")
limit = app.state.config.max_body_bytes
if content_length and content_length.isdigit() and int(content_length) > limit:
return error_response(
response = error_response(
413,
"PAYLOAD_TOO_LARGE",
f"тело запроса {content_length} байт, максимум {limit}",
request.state.trace_id,
)
response.headers["X-Trace-Id"] = request.state.trace_id
return response
started = time.perf_counter()
response = await call_next(request)
response.headers["X-Trace-Id"] = request.state.trace_id