1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-11 15:52:25 -05:00

cleaned up configuration files to use appsettings

This commit is contained in:
RaidMax
2018-03-14 00:36:25 -05:00
parent c3d5f6ac26
commit d836f71b1b
22 changed files with 199 additions and 170 deletions

View File

@ -9,7 +9,7 @@ namespace WebfrontCore.Application.Misc
{
public class VPNCheck
{
public static async Task<bool> UsingVPN(string ip)
public static async Task<bool> UsingVPN(string ip, string apiKey)
{
#if DEBUG
return false;
@ -18,7 +18,7 @@ namespace WebfrontCore.Application.Misc
{
using (var RequestClient = new System.Net.Http.HttpClient())
{
RequestClient.DefaultRequestHeaders.Add("X-Key", Startup.Configuration["VPN:APIKey"]);
RequestClient.DefaultRequestHeaders.Add("X-Key", apiKey);
string response = await RequestClient.GetStringAsync($"http://v2.api.iphub.info/ip/{ip}");
var responseJson = JsonConvert.DeserializeObject<JObject>(response);
int blockType = Convert.ToInt32(responseJson["block"]);