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

Commit ea77d8f

Browse files
committed
[client] User-Agent on all requests from the library (#341)
1 parent 26c8eee commit ea77d8f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pycti/api/opencti_api_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import urllib3
1212
from pythonjsonlogger import jsonlogger
1313

14+
from pycti import __version__
1415
from pycti.api import LOGGER
1516
from pycti.api.opencti_api_connector import OpenCTIApiConnector
1617
from pycti.api.opencti_api_work import OpenCTIApiWork
@@ -145,7 +146,10 @@ def __init__(
145146
# Define API
146147
self.api_token = token
147148
self.api_url = url + "/graphql"
148-
self.request_headers = {"Authorization": "Bearer " + token}
149+
self.request_headers = {
150+
"User-Agent": "pycti/" + __version__,
151+
"Authorization": "Bearer " + token,
152+
}
149153
self.session = requests.session()
150154

151155
# Define the dependencies

0 commit comments

Comments
 (0)