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:
@ -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}',
|
||||
|
Reference in New Issue
Block a user