python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

SseServerTransport should better handle the quoting the post message endpoint.

Open pradeepvishwakarma opened this issue 8 months ago • 0 comments

Just pointing out the issue where it malformed the endpoint url. Can we send full endpoint instead of passing the route as some sse integration requires full endpoints.

>> sse.py -> SseServerTransport -> connect_sse

from urllib.parse import quote from uuid import uuid4

session_id = uuid4() root_path = "https://example.com/api_prefix" full_message_path_for_client = root_path.rstrip("/") + "/messages" client_post_uri_data = ( f"{quote(full_message_path_for_client)}?session_id={session_id.hex}" ) print(client_post_uri_data)

Output : https%3A//example.com/api_prefix/messages?session_id=0bb8b48cc4d1447c992e6872f2668b05 Expected : https://example.com/api_prefix/messages?session_id=0bb8b48cc4d1447c992e6872f2668b05

pradeepvishwakarma avatar May 28 '25 09:05 pradeepvishwakarma