mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +00:00
Don't set headers kwargs multiple times (#72779)
This commit is contained in:
parent
a54a5b2d20
commit
647df29a00
@ -493,13 +493,13 @@ async def async_oauth2_request(
|
|||||||
This method will not refresh tokens. Use OAuth2 session for that.
|
This method will not refresh tokens. Use OAuth2 session for that.
|
||||||
"""
|
"""
|
||||||
session = async_get_clientsession(hass)
|
session = async_get_clientsession(hass)
|
||||||
|
headers = kwargs.pop("headers", {})
|
||||||
return await session.request(
|
return await session.request(
|
||||||
method,
|
method,
|
||||||
url,
|
url,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
headers={
|
headers={
|
||||||
**(kwargs.get("headers") or {}),
|
**headers,
|
||||||
"authorization": f"Bearer {token['access_token']}",
|
"authorization": f"Bearer {token['access_token']}",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user