MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / add_middleware

Function add_middleware

utils/middleware.py:118–128  ·  view source on GitHub ↗

Add all middleware to the FastAPI application.

(app: FastAPI)

Source from the content-addressed store, hash-verified

116
117
118def add_middleware(app: FastAPI):
119 """Add all middleware to the FastAPI application."""
120 # Attach CORS first to handle preflight requests and allow origins.
121 add_cors_middleware(app)
122
123 # Add other middleware
124 app.middleware("http")(correlation_id_middleware)
125 app.middleware("http")(security_middleware)
126 # app.middleware("http")(rate_limit_middleware) # Enable if needed
127
128 return app

Callers 1

init_appFunction · 0.90

Calls 1

add_cors_middlewareFunction · 0.85

Tested by

no test coverage detected