Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Added user agent to API calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
RequiDev committed Sep 24, 2021
1 parent 0e6a72f commit 155bc61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ReModCE/Components/AvatarFavoritesComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using UnityEngine.XR;
using VRC.Core;
using VRC.SDKBase.Validation.Performance.Stats;
using AvatarList = Il2CppSystem.Collections.Generic.List<VRC.Core.ApiAvatar>;
Expand Down Expand Up @@ -67,6 +68,7 @@ public AvatarFavoritesComponent()
CookieContainer = new CookieContainer()
};
_httpClient = new HttpClient(_httpClientHandler);
_httpClient.DefaultRequestHeaders.UserAgent.ParseAdd($"ReModCE/1.0 ({(XRDevice.isPresent ? XRDevice.model : "Desktop")}; {Application.version})");

AvatarFavoritesEnabled = new ConfigValue<bool>(nameof(AvatarFavoritesEnabled), true);
AvatarFavoritesEnabled.OnValueChanged += () =>
Expand Down Expand Up @@ -147,6 +149,7 @@ public override void OnUiManagerInit(UiManager uiManager)
CookieContainer = new CookieContainer()
};
_httpClient = new HttpClient(_httpClientHandler);
_httpClient.DefaultRequestHeaders.UserAgent.ParseAdd($"ReModCE/1.0 ({(XRDevice.isPresent ? XRDevice.model : "Desktop")}; {Application.version})");

LoginToAPI(APIUser.CurrentUser, FetchAvatars);
}, null);
Expand Down

0 comments on commit 155bc61

Please sign in to comment.