mirror of
https://github.com/discourse/discourse.git
synced 2025-03-24 11:35:46 +08:00

Onebox embeds currently default to accepting any language response from the destination, which can have some surprising behaviour. For example the `curl` equivalent of what Onebox does: ``` % curl -si -H "Accept-Language: *" 'https://developer.android.com/studio' | grep location: location: /studio?hl=hi ``` This PR uses the value of `SiteSetting.default_locale` to populate the `Accept-Language` header, falling back to English if that isn't available, then finally accepting whatever language the destination makes available.