Skip to content

Commit e1e5716

Browse files
saartochner-lumigoCircleCI
andauthored
RD-7827 - add token to request's headers (#243)
* add token to request's headers Co-authored-by: CircleCI <no-reply@build.com>
1 parent 03ed02d commit e1e5716

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ repos:
44
hooks:
55
- id: black
66
language_version: python3.7
7+
additional_dependencies: ['click==8.0.4']
78

89
- repo: https://github.com/pre-commit/mirrors-mypy
910
rev: v0.782

src/lumigo_tracer/lumigo_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,13 @@ def report_json(
361361
try:
362362
start_time = time.time()
363363
edge_connection.request(
364-
"POST", EDGE_PATH, to_send, headers={"Content-Type": "application/json"}
364+
"POST",
365+
EDGE_PATH,
366+
to_send,
367+
headers={"Content-Type": "application/json", "Authorization": Configuration.token},
365368
)
366369
response = edge_connection.getresponse()
367-
response.read() # We most read the response to keep the connection available
370+
response.read() # We must read the response to keep the connection available
368371
duration = int((time.time() - start_time) * 1000)
369372
get_logger().info(f"successful reporting, code: {getattr(response, 'code', 'unknown')}")
370373
except socket.timeout:

0 commit comments

Comments
 (0)