space -> hyphen in Accept-Language, capatilise in test

pull/7265/head
Andrew Morgan 2020-04-14 18:17:30 +01:00
parent 037557fbf5
commit 0268d4fc8e
2 changed files with 5 additions and 5 deletions

View File

@ -321,7 +321,7 @@ class PreviewUrlResource(DirectServeResource):
url,
output_stream=f,
max_size=self.max_spider_size,
headers={"Accept Language": self.url_preview_accept_language},
headers={"Accept-Language": self.url_preview_accept_language},
)
except SynapseError:
# Pass SynapseErrors through directly, so that the servlet

View File

@ -555,10 +555,10 @@ class URLPreviewTests(unittest.HomeserverTestCase):
# of the request from Synapse
self.assertIn(
(
b"Accept language: en-UK\r\n"
b"Accept language: en-US;q=0.9\r\n"
b"Accept language: fr;q=0.8\r\n"
b"Accept language: *;q=0.7"
b"Accept-Language: en-UK\r\n"
b"Accept-Language: en-US;q=0.9\r\n"
b"Accept-Language: fr;q=0.8\r\n"
b"Accept-Language: *;q=0.7"
),
server.data,
)