element-hq / element-hq/synapse
URL preview should use `Accept-Language: en-US, en` by default
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#11604](https://github.com/matrix-org/synapse/issues/11604).
---
### Description
This is about the `url_preview_accept_language` setting, which seems to have a default value of `['en']`.
This may be site-specific, but.. as an example, I find that doing `curl -H 'Accept-Language: en' 'https://www.imdb.com/title/tt13207508/' | grep Schwanengesang` yields a result for me ("Schwanengesang" being the German title of the "Swan Song" movie) when done from a German IP address.
A way to get it to stop IMDB from feeding me German content (when accessing it from a German IP address) is to use a different `Accept-Language` value. Both `en-US` and `en-US, en` seem to work well.
Given that browsers (Firefox, Chromium) seem to pass both `{languageCode}-{countryCode}` and `{languageCode}` at the same time, it's probably more reliable if Synapse does the same (sending `Accept-Language: en-US, en`).
### Version information
- **Version**: v1.49.0 seems affected by default
Contributor guide
Assessment
This issue has not been assessed yet.