backend/fastapi/app/middleware/middleware.py
2024-12-06 14:12:28 +09:00

10 lines
377 B
Python

from fastapi import FastAPI, Request
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from starlette.responses import Response
import time
class TimeHeaderMiddleware(BaseHTTPMiddleware) :
async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response:
return await super().dispatch(request, call_next)