Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 7e5b471

Browse files
committed
[client] Fix SSE recover header when crash occurs (#322)
1 parent 5656e6e commit 7e5b471

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ def run(self) -> None: # pylint: disable=too-many-branches
400400
q = Queue(maxsize=1)
401401
stream_alive = StreamAlive(q)
402402
stream_alive.start()
403-
# Computing args, from is always set
404-
live_stream_args = "?from=" + start_from
403+
# Computing args building
404+
live_stream_url = self.url
405405
# In case no recover is explicitely set
406406
if recover_until is not False and recover_until not in [
407407
"no",
@@ -411,8 +411,7 @@ def run(self) -> None: # pylint: disable=too-many-branches
411411
"false",
412412
"False",
413413
]:
414-
live_stream_args = live_stream_args + "&recover=" + recover_until
415-
live_stream_url = self.url + live_stream_args
414+
live_stream_url = live_stream_url + "?recover=" + recover_until
416415
listen_delete = str(self.listen_delete).lower()
417416
no_dependencies = str(self.no_dependencies).lower()
418417
with_inferences = str(self.with_inferences).lower()
@@ -423,6 +422,7 @@ def run(self) -> None: # pylint: disable=too-many-branches
423422
)
424423
messages = SSEClient(
425424
live_stream_url,
425+
start_from,
426426
headers={
427427
"authorization": "Bearer " + self.token,
428428
"listen-delete": listen_delete,

0 commit comments

Comments
 (0)