mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
@@ -23,7 +23,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using ArchiSteamFarm.IPC.Integration;
|
||||
@@ -56,13 +55,13 @@ public sealed class IPCBansController : ArchiController {
|
||||
ArgumentException.ThrowIfNullOrEmpty(ipAddress);
|
||||
|
||||
if (!IPAddress.TryParse(ipAddress, out IPAddress? remoteAddress)) {
|
||||
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(ipAddress))));
|
||||
return BadRequest(new GenericResponse(false, Strings.FormatErrorIsInvalid(nameof(ipAddress))));
|
||||
}
|
||||
|
||||
bool result = ApiAuthenticationMiddleware.UnbanIP(remoteAddress);
|
||||
|
||||
if (!result) {
|
||||
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIPNotBanned, ipAddress)));
|
||||
return BadRequest(new GenericResponse(false, Strings.FormatErrorIPNotBanned(ipAddress)));
|
||||
}
|
||||
|
||||
return Ok(new GenericResponse(true));
|
||||
|
||||
Reference in New Issue
Block a user