Skip to content

Commit da43f65

Browse files
committed
Supply default value for generate_correlation_id
1 parent a903e74 commit da43f65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ghga_service_commons/http/correlation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ async def _cid_request_hook_async(request, generate_correlation_id: bool):
5757
def attach_correlation_id_to_requests(
5858
client: Union[httpx.Client, httpx.AsyncClient],
5959
*,
60-
generate_correlation_id: bool,
60+
generate_correlation_id: bool = True,
6161
):
6262
"""Add an event hook to an httpx Client that includes the correlation ID header."""
6363
is_async = isinstance(client, httpx.AsyncClient)
6464
event_hook = partial(
65-
_cid_request_hook_async if is_asycnc else _cid_request_hook,
65+
_cid_request_hook_async if is_async else _cid_request_hook,
6666
generate_correlation_id=generate_correlation_id,
6767
)
6868
client.event_hooks.setdefault("request", []).append(event_hook)

0 commit comments

Comments
 (0)