From cc255d488eefd953d14420cb7e7ef3b4d1cf4911 Mon Sep 17 00:00:00 2001 From: rafaelmmiller <150964962+rafaelsideguide@users.noreply.github.com> Date: Fri, 14 Mar 2025 18:27:42 -0300 Subject: [PATCH] fixed websocket params --- apps/python-sdk/firecrawl/firecrawl.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/python-sdk/firecrawl/firecrawl.py b/apps/python-sdk/firecrawl/firecrawl.py index d62312c6..990599cc 100644 --- a/apps/python-sdk/firecrawl/firecrawl.py +++ b/apps/python-sdk/firecrawl/firecrawl.py @@ -1855,7 +1855,10 @@ class CrawlWatcher: """ Establishes WebSocket connection and starts listening for messages. """ - async with websockets.connect(self.ws_url, extra_headers={"Authorization": f"Bearer {self.app.api_key}"}) as websocket: + async with websockets.connect( + self.ws_url, + additional_headers=[("Authorization", f"Bearer {self.app.api_key}")] + ) as websocket: await self._listen(websocket) async def _listen(self, websocket) -> None: @@ -3231,7 +3234,10 @@ class AsyncCrawlWatcher(CrawlWatcher): """ Establishes async WebSocket connection and starts listening for messages. """ - async with websockets.connect(self.ws_url, extra_headers={"Authorization": f"Bearer {self.app.api_key}"}) as websocket: + async with websockets.connect( + self.ws_url, + additional_headers=[("Authorization", f"Bearer {self.app.api_key}")] + ) as websocket: await self._listen(websocket) async def _listen(self, websocket) -> None: