Add Happy Eyeballs Support (#1187)

This commit is contained in:
KazWolfe 2023-04-23 02:09:55 -07:00 committed by GitHub
parent 2e2ce241e2
commit 6a0b4e5ad7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 271 additions and 18 deletions

View file

@ -1,7 +1,7 @@
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Dalamud.Networking.Http;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Utility;
using Newtonsoft.Json;
@ -42,9 +42,11 @@ internal static class BugBait
{
model.Exception = Troubleshooting.LastException == null ? "Was included, but none happened" : Troubleshooting.LastException?.ToString();
}
var httpClient = Service<HappyHttpClient>.Get().SharedHttpClient;
var postContent = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json");
var response = await Util.HttpClient.PostAsync(BugBaitUrl, postContent);
var response = await httpClient.PostAsync(BugBaitUrl, postContent);
response.EnsureSuccessStatusCode();
}