Fix SimpleHttpClient not sending Accept header in get_json (#11677)

Co-authored-by: reivilibre <olivier@librepush.net>
This commit is contained in:
Fr3shTea 2022-01-05 11:59:29 +00:00 committed by GitHub
parent 7a1cefc6e3
commit 0201c6371c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

1
changelog.d/11677.bugfix Normal file
View File

@ -0,0 +1 @@
Fix wrong variable reference in `SimpleHttpClient.get_json` that results in the absence of the `Accept` header in the request.

View File

@ -588,7 +588,7 @@ class SimpleHttpClient:
if headers: if headers:
actual_headers.update(headers) # type: ignore actual_headers.update(headers) # type: ignore
body = await self.get_raw(uri, args, headers=headers) body = await self.get_raw(uri, args, headers=actual_headers)
return json_decoder.decode(body.decode("utf-8")) return json_decoder.decode(body.decode("utf-8"))
async def put_json( async def put_json(