mirror of
https://github.com/plexusorg/Module-HTTPD.git
synced 2024-11-24 20:55:00 +00:00
Just say fuck you if an IP wasn't detected
This commit is contained in:
parent
98f974b634
commit
1096ed1e09
@ -21,10 +21,10 @@ public class AdminsEndpoint extends AbstractServlet
|
|||||||
@GetMapping(endpoint = "/api/admins/")
|
@GetMapping(endpoint = "/api/admins/")
|
||||||
public String getAdmins(HttpServletRequest request)
|
public String getAdmins(HttpServletRequest request)
|
||||||
{
|
{
|
||||||
String ipAddress = request.getHeader("X-FORWARDED-FOR");
|
String ipAddress = request.getRemoteAddr();
|
||||||
if (ipAddress == null)
|
if (ipAddress == null)
|
||||||
{
|
{
|
||||||
ipAddress = request.getRemoteAddr();
|
return "An IP address could not be detected. Please ensure you are connecting using IPv4.";
|
||||||
}
|
}
|
||||||
final PlexPlayer player = DataUtils.getPlayerByIP(ipAddress);
|
final PlexPlayer player = DataUtils.getPlayerByIP(ipAddress);
|
||||||
if (player == null)
|
if (player == null)
|
||||||
|
@ -19,10 +19,10 @@ public class IndefBansEndpoint extends AbstractServlet
|
|||||||
@GetMapping(endpoint = "/api/indefbans/")
|
@GetMapping(endpoint = "/api/indefbans/")
|
||||||
public String getBans(HttpServletRequest request)
|
public String getBans(HttpServletRequest request)
|
||||||
{
|
{
|
||||||
String ipAddress = request.getHeader("X-FORWARDED-FOR");
|
String ipAddress = request.getRemoteAddr();
|
||||||
if (ipAddress == null)
|
if (ipAddress == null)
|
||||||
{
|
{
|
||||||
ipAddress = request.getRemoteAddr();
|
return "An IP address could not be detected. Please ensure you are connecting using IPv4.";
|
||||||
}
|
}
|
||||||
final PlexPlayer player = DataUtils.getPlayerByIP(ipAddress);
|
final PlexPlayer player = DataUtils.getPlayerByIP(ipAddress);
|
||||||
if (player == null)
|
if (player == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user