From 261095e2a5a45e473c2d3f590aba1cb6748e187a Mon Sep 17 00:00:00 2001 From: Uladzislau Vishneuski Date: Wed, 21 Feb 2024 22:52:20 +0100 Subject: [PATCH] fix: working fastapi event listeners with enabled propagation_auth_headers (#56) --- aidial_sdk/header_propagator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aidial_sdk/header_propagator.py b/aidial_sdk/header_propagator.py index cb2a333..1b2f4a9 100644 --- a/aidial_sdk/header_propagator.py +++ b/aidial_sdk/header_propagator.py @@ -23,7 +23,7 @@ def __init__( async def __call__( self, scope: Scope, receive: Receive, send: Send ) -> None: - for header in scope["headers"]: + for header in scope.get("headers") or []: if header[0] == b"api-key": self.api_key.set(header[1].decode("utf-8"))