Jeremiah Lowin commited on
Commit
6ad1252
·
1 Parent(s): 86eb39a

Update http.py

Browse files
Files changed (1) hide show
  1. src/fastmcp/server/http.py +2 -4
src/fastmcp/server/http.py CHANGED
@@ -157,9 +157,8 @@ def create_sse_app(
157
  Returns:
158
  A Starlette application with RequestContextMiddleware
159
  """
160
-
161
  # Ensure the message_path ends with a trailing slash to avoid automatic redirects
162
- # when mounting the application. sse_path uses Route instead of Mount so no fix needed.
163
  if not message_path.endswith("/"):
164
  message_path = message_path + "/"
165
 
@@ -311,11 +310,10 @@ def create_streamable_http_app(
311
  raise
312
 
313
  # Ensure the streamable_http_path ends with a trailing slash to avoid automatic redirects
314
- # when mounting the application
315
  if not streamable_http_path.endswith("/"):
316
  streamable_http_path = streamable_http_path + "/"
317
 
318
- # Add StreamableHTTP routes with or without auth
319
  if auth:
320
  auth_middleware, auth_routes, required_scopes = (
321
  setup_auth_middleware_and_routes(auth)
 
157
  Returns:
158
  A Starlette application with RequestContextMiddleware
159
  """
160
+
161
  # Ensure the message_path ends with a trailing slash to avoid automatic redirects
 
162
  if not message_path.endswith("/"):
163
  message_path = message_path + "/"
164
 
 
310
  raise
311
 
312
  # Ensure the streamable_http_path ends with a trailing slash to avoid automatic redirects
 
313
  if not streamable_http_path.endswith("/"):
314
  streamable_http_path = streamable_http_path + "/"
315
 
316
+ # Add StreamableHTTP routes with or without auth
317
  if auth:
318
  auth_middleware, auth_routes, required_scopes = (
319
  setup_auth_middleware_and_routes(auth)