Fix typos: requestor -> requester, Implementors -> Implementers by TheChyeahhh · Pull Request #2728 · modelcontextprotocol/python-sdk · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mcp/server/auth/provider.py
4 changes: 2 additions & 2 deletions src/mcp/server/sse.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ async def handle_post_message(self, scope: Scope, receive: Receive, send: Send)
return await response(scope, receive, send)

user = scope.get("user")
requestor = authorization_context(user) if isinstance(user, AuthenticatedUser) else None
if requestor != self._session_owners.get(session_id):
requester = authorization_context(user) if isinstance(user, AuthenticatedUser) else None
if requester != self._session_owners.get(session_id):
# A session can only be used with the credential that created it.
# Respond exactly as if the session did not exist.
logger.warning("Rejecting message for session %s: credential does not match", session_id)
Expand Down
8 changes: 4 additions & 4 deletions src/mcp/server/streamable_http_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ async def _handle_stateful_request(self, scope: Scope, receive: Receive, send: S
request_mcp_session_id = request.headers.get(MCP_SESSION_ID_HEADER)

user = scope.get("user")
requestor = authorization_context(user) if isinstance(user, AuthenticatedUser) else None
requester = authorization_context(user) if isinstance(user, AuthenticatedUser) else None

# Existing session case
if request_mcp_session_id is not None and request_mcp_session_id in self._server_instances:
transport = self._server_instances[request_mcp_session_id]
if requestor != self._session_owners.get(request_mcp_session_id):
if requester != self._session_owners.get(request_mcp_session_id):
# A session can only be used with the credential that created
# it. Respond exactly as if the session did not exist.
logger.warning(
Expand Down Expand Up @@ -240,8 +240,8 @@ async def _handle_stateful_request(self, scope: Scope, receive: Receive, send: S
)

assert http_transport.mcp_session_id is not None
if requestor is not None:
self._session_owners[http_transport.mcp_session_id] = requestor
if requester is not None:
self._session_owners[http_transport.mcp_session_id] = requester
self._server_instances[http_transport.mcp_session_id] = http_transport
logger.info(f"Created new transport with session ID: {new_session_id}")

Expand Down
2 changes: 1 addition & 1 deletion src/mcp/types/_types.py
Loading