Remove automatic trailing slash modification from server paths

Closes #991

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jeremiah Lowin 2025-06-30 18:32:53 -04:00
commit e17397af91

View file

@ -158,10 +158,6 @@ def create_sse_app(
A Starlette application with RequestContextMiddleware
"""
# Ensure the message_path ends with a trailing slash to avoid automatic redirects
if not message_path.endswith("/"):
message_path = message_path + "/"
server_routes: list[BaseRoute] = []
server_middleware: list[Middleware] = []
@ -309,10 +305,6 @@ def create_streamable_http_app(
# Re-raise other RuntimeErrors if they don't match the specific message
raise
# Ensure the streamable_http_path ends with a trailing slash to avoid automatic redirects
if not streamable_http_path.endswith("/"):
streamable_http_path = streamable_http_path + "/"
# Add StreamableHTTP routes with or without auth
if auth:
auth_middleware, auth_routes, required_scopes = (