From ac95a3aaafafd34719bc01dd8f9e1efb8070d965 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Fri, 20 Jun 2025 12:53:42 -0400 Subject: [PATCH] Update http.py --- src/fastmcp/server/http.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/fastmcp/server/http.py b/src/fastmcp/server/http.py index a80b2235c..7041ba975 100644 --- a/src/fastmcp/server/http.py +++ b/src/fastmcp/server/http.py @@ -157,9 +157,8 @@ def create_sse_app( Returns: A Starlette application with RequestContextMiddleware """ - + # Ensure the message_path ends with a trailing slash to avoid automatic redirects - # when mounting the application. sse_path uses Route instead of Mount so no fix needed. if not message_path.endswith("/"): message_path = message_path + "/" @@ -311,11 +310,10 @@ def create_streamable_http_app( raise # Ensure the streamable_http_path ends with a trailing slash to avoid automatic redirects - # when mounting the application if not streamable_http_path.endswith("/"): streamable_http_path = streamable_http_path + "/" - # Add StreamableHTTP routes with or without auth + # Add StreamableHTTP routes with or without auth if auth: auth_middleware, auth_routes, required_scopes = ( setup_auth_middleware_and_routes(auth)