Docker: фикс прав на /srv/.cache для appuser; X-Trace-Id в раннем 413
This commit is contained in:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user