From 6391a68fd59fccec64c7f68a3daf2584f4e66a2e Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 18 Oct 2019 18:11:54 -0700 Subject: [PATCH] Better header check for OAuth2 helper (#27897) --- homeassistant/helpers/config_entry_oauth2_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/helpers/config_entry_oauth2_flow.py b/homeassistant/helpers/config_entry_oauth2_flow.py index 043a28cac27..7fb954378ee 100644 --- a/homeassistant/helpers/config_entry_oauth2_flow.py +++ b/homeassistant/helpers/config_entry_oauth2_flow.py @@ -392,7 +392,7 @@ async def async_oauth2_request( url, **kwargs, headers={ - **kwargs.get("headers", {}), + **(kwargs.get("headers") or {}), "authorization": f"Bearer {token['access_token']}", }, )