Skip to content

Commit 07fa812

Browse files
authored
Add: follow redirect (#82)
1 parent 116f495 commit 07fa812

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

utils/mcp_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def send_message(self, data: dict):
109109
url=self.endpoint_url,
110110
json=data,
111111
headers={'Content-Type': 'application/json', 'trace-id': data["id"] if "id" in data else ""},
112-
timeout=self.timeout
112+
timeout=self.timeout,
113+
follow_redirects=True
113114
)
114115
response.raise_for_status()
115116
logging.debug(f"{self.name} - Client message sent successfully: {response.status_code}")
@@ -231,7 +232,8 @@ def send_message(self, data: dict):
231232
url=self.url,
232233
json=data,
233234
headers=headers,
234-
timeout=self.timeout
235+
timeout=self.timeout,
236+
follow_redirects=True
235237
)
236238
self.session_id = response.headers.get("mcp-session-id", None)
237239
content_type = response.headers.get("content-type", "None")

0 commit comments

Comments
 (0)