Don't set headers kwargs multiple times (#72779)

pull/72784/head
Joakim Plate 2022-05-31 22:08:50 +02:00 committed by GitHub
parent 35ee4ad55b
commit 84779482b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -493,13 +493,13 @@ async def async_oauth2_request(
This method will not refresh tokens. Use OAuth2 session for that.
"""
session = async_get_clientsession(hass)
headers = kwargs.pop("headers", {})
return await session.request(
method,
url,
**kwargs,
headers={
**(kwargs.get("headers") or {}),
**headers,
"authorization": f"Bearer {token['access_token']}",
},
)