1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

more updates for script plugin helper and corresponding VPNDetection update to properly send user gent

This commit is contained in:
RaidMax
2023-04-13 23:36:29 -05:00
parent a461f5af25
commit d3a2209f73
2 changed files with 7 additions and 15 deletions

View File

@ -191,13 +191,15 @@ const plugin = {
}
const userAgent = `IW4MAdmin-${this.manager.getApplicationSettings().configuration().id}`;
const headers = {
'User-Agent': userAgent
};
const stringDict = System.Collections.Generic.Dictionary(System.String, System.String);
const headers = new stringDict();
headers.add('User-Agent', userAgent);
const pluginScript = importNamespace('IW4MAdmin.Application.Plugin.Script');
const request = new pluginScript.ScriptPluginWebRequest(`https://api.xdefcon.com/proxy/check/?ip=${origin.IPAddressString}`,
null, 'GET', 'application/json', headers);
try {
this.pluginHelper.getUrl(`https://api.xdefcon.com/proxy/check/?ip=${origin.IPAddressString}`, headers,
(response) => this.onVpnResponse(response, origin));
this.pluginHelper.requestUrl(request, (response) => this.onVpnResponse(response, origin));
} catch (ex) {
this.logger.logWarning('There was a problem checking client IP ({IP}) for VPN - {message}',