From d3e4eaff0c8a34e20dd18451bfc945acb3489bb8 Mon Sep 17 00:00:00 2001 From: L4XB Date: Thu, 17 Sep 2026 19:43:11 +0200 Subject: [PATCH] test(proxy): cover a websocket bearer token with extra whitespace The master-key acceptance test now also sends the key after a double space, so dropping the strip on the bearer token, or keeping its prefix, fails a test --- tests/test_litellm/proxy/auth/test_user_api_key_auth.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_litellm/proxy/auth/test_user_api_key_auth.py b/tests/test_litellm/proxy/auth/test_user_api_key_auth.py index 9a8dc5e262d..739cd7cfab0 100644 --- a/tests/test_litellm/proxy/auth/test_user_api_key_auth.py +++ b/tests/test_litellm/proxy/auth/test_user_api_key_auth.py @@ -8612,6 +8612,7 @@ async def test_websocket_auth_without_master_key_accepts_a_keyless_client(header "headers", [ pytest.param({"authorization": "Bearer sk-master-key"}, id="bearer token"), + pytest.param({"authorization": "Bearer sk-master-key"}, id="bearer token with extra space"), pytest.param({"api-key": "sk-master-key"}, id="api-key header"), pytest.param( {"sec-websocket-protocol": "realtime, openai-insecure-api-key.sk-master-key"},