fix(bot): ignore charset from discord cdn for export files
This commit is contained in:
parent
f58ada7fac
commit
f6a9d693cd
@ -47,6 +47,9 @@ public class ImportExport
|
|||||||
var response = await _client.GetAsync(url);
|
var response = await _client.GetAsync(url);
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
throw Errors.InvalidImportFile;
|
throw Errors.InvalidImportFile;
|
||||||
|
// hacky fix for discord api returning nonsense charsets sometimes
|
||||||
|
response.Content.Headers.Remove("content-type");
|
||||||
|
response.Content.Headers.Add("content-type", "application/json; charset=UTF-8");
|
||||||
data = JsonConvert.DeserializeObject<JObject>(
|
data = JsonConvert.DeserializeObject<JObject>(
|
||||||
await response.Content.ReadAsStringAsync(),
|
await response.Content.ReadAsStringAsync(),
|
||||||
_settings
|
_settings
|
||||||
|
Loading…
Reference in New Issue
Block a user