Skip to content

Commit 3728328

Browse files
author
eyeonyou
committed
style: format to avoid max-line validation error
1 parent 96baf33 commit 3728328

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mcp/server/sse.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,12 @@ async def connect_sse(self, scope: Scope, receive: Receive, send: Send):
9797

9898
session_id = uuid4()
9999
request_path = scope["path"]
100+
100101
match = re.match(r"^/([^/]+(?:/mcp)?)/sse$", request_path)
101102
mount_prefix = match.group(1) if match else ""
102-
session_uri = f"/{quote(mount_prefix)}{quote(self._endpoint)}?session_id={session_id.hex}"
103+
104+
session_uri = f"/{quote(mount_prefix)}{quote(self._endpoint)}"
105+
session_uri += f"?session_id={session_id.hex}"
103106

104107
self._read_stream_writers[session_id] = read_stream_writer
105108
logger.debug(f"Created new session with ID: {session_id}")

0 commit comments

Comments
 (0)