mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-28 02:10:38 +02:00
Ensure custom routes are respected
This commit is contained in:
parent
4dc6fe2941
commit
189389a3a4
5 changed files with 107 additions and 3 deletions
|
|
@ -241,6 +241,7 @@ def create_sse_app(
|
|||
# Add custom routes with lowest precedence
|
||||
if routes:
|
||||
server_routes.extend(routes)
|
||||
server_routes.extend(server._additional_http_routes)
|
||||
|
||||
# Add middleware
|
||||
if middleware:
|
||||
|
|
@ -359,6 +360,7 @@ def create_streamable_http_app(
|
|||
# Add custom routes with lowest precedence
|
||||
if routes:
|
||||
server_routes.extend(routes)
|
||||
server_routes.extend(server._additional_http_routes)
|
||||
|
||||
# Add middleware
|
||||
if middleware:
|
||||
|
|
|
|||
|
|
@ -854,7 +854,6 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
auth_server_provider=self._auth_server_provider,
|
||||
auth_settings=self.settings.auth,
|
||||
debug=self.settings.debug,
|
||||
routes=self._additional_http_routes,
|
||||
middleware=middleware,
|
||||
)
|
||||
|
||||
|
|
@ -905,7 +904,6 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
json_response=self.settings.json_response,
|
||||
stateless_http=self.settings.stateless_http,
|
||||
debug=self.settings.debug,
|
||||
routes=self._additional_http_routes,
|
||||
middleware=middleware,
|
||||
)
|
||||
elif transport == "sse":
|
||||
|
|
@ -916,7 +914,6 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
auth_server_provider=self._auth_server_provider,
|
||||
auth_settings=self.settings.auth,
|
||||
debug=self.settings.debug,
|
||||
routes=self._additional_http_routes,
|
||||
middleware=middleware,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue