skeleton lab7 and tasks for grade 3
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-11-21 16:21:47 +03:00
parent 20afc2c790
commit 0b97f77d76
185 changed files with 15590 additions and 154 deletions
+22
View File
@@ -0,0 +1,22 @@
from uuid import uuid4
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from starlette.requests import Request
from starlette.responses import Response
REQUEST_ID_HEADER = "X-Request-Id"
class RequestIdMiddleware(BaseHTTPMiddleware):
async def dispatch(
self,
request: Request,
call_next: RequestResponseEndpoint,
) -> Response:
request_id = str(uuid4())
request.state.request_id = request_id
response = await call_next(request)
response.headers[REQUEST_ID_HEADER] = request_id
return response