Skip to content

SseServerTransport should better handle the quoting the post message endpoint. #827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pradeepvishwakarma opened this issue May 28, 2025 · 0 comments

Comments

@pradeepvishwakarma
Copy link

pradeepvishwakarma commented May 28, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant