Skip to content

Commit c3999d6

Browse files
Fix #1592 by encoding aiohttp client session pings (#1593)
1 parent 6bcf7ec commit c3999d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

slack_sdk/socket_mode/aiohttp/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ async def monitor_current_session(self) -> None:
172172
if self.last_ping_pong_time is None:
173173
self.last_ping_pong_time = float(t)
174174
try:
175-
await session.ping(f"sdk-ping-pong:{t}")
175+
await session.ping(f"sdk-ping-pong:{t}".encode("utf-8"))
176176
except Exception as e:
177177
# The ping() method can fail for some reason.
178178
# To establish a new connection even in this scenario,
@@ -387,7 +387,7 @@ async def connect(self):
387387
if self.logger.level <= logging.DEBUG:
388388
self.logger.debug(f"Sending a ping message with the newly established connection ({session_id})...")
389389
t = time.time()
390-
await self.current_session.ping(f"sdk-ping-pong:{t}")
390+
await self.current_session.ping(f"sdk-ping-pong:{t}".encode("utf-8"))
391391

392392
if self.current_session_monitor is not None:
393393
self.current_session_monitor.cancel()

0 commit comments

Comments
 (0)