From 0201c6371cdfa0e8245c59686c131e40384bbac2 Mon Sep 17 00:00:00 2001
From: Fr3shTea <31766876+Fr3shTea@users.noreply.github.com>
Date: Wed, 5 Jan 2022 11:59:29 +0000
Subject: [PATCH] Fix SimpleHttpClient not sending Accept header in `get_json`
 (#11677)

Co-authored-by: reivilibre <olivier@librepush.net>
---
 changelog.d/11677.bugfix | 1 +
 synapse/http/client.py   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 changelog.d/11677.bugfix

diff --git a/changelog.d/11677.bugfix b/changelog.d/11677.bugfix
new file mode 100644
index 0000000000..5691064a30
--- /dev/null
+++ b/changelog.d/11677.bugfix
@@ -0,0 +1 @@
+Fix wrong variable reference in `SimpleHttpClient.get_json` that results in the absence of the `Accept` header in the request.
diff --git a/synapse/http/client.py b/synapse/http/client.py
index fbbeceabeb..ca33b45cb2 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -588,7 +588,7 @@ class SimpleHttpClient:
         if headers:
             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"))
 
     async def put_json(
-- 
GitLab