From 8d017e93c754c097b8d1cda9a1c2be36f3b378f3 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@jalin.de>
Date: Fri, 04 Oct 2019 18:08:05 +0200
Subject: [PATCH] for testing purpose

---
 hsarback/src/de/hsadmin/core/util/IPv6Trick.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/hsarback/src/de/hsadmin/core/util/IPv6Trick.java b/hsarback/src/de/hsadmin/core/util/IPv6Trick.java
index 835331a..85847cd 100644
--- a/hsarback/src/de/hsadmin/core/util/IPv6Trick.java
+++ b/hsarback/src/de/hsadmin/core/util/IPv6Trick.java
@@ -7,6 +7,10 @@
 
 public class IPv6Trick {
 	
+	private static final String IPv4_LOCALHOST = "127.0.0";
+	private static final String IPv6_LOCALHOST = "::1";
+	private static final String IPv6_LOCALHOST_ALT = "0:0:0:0:0:0:0:1";
+	
 	private static final String IPv4_83_223_79 = "83.223.79"; 	// Alboin-Kontor Berlin
 	private static final String IPv4_83_223_91 = "83.223.91"; 	// Alboin-Kontor Berlin
 	private static final String IPv4_83_223_95 = "83.223.95"; 	// Alboin-Kontor Berlin
@@ -42,6 +46,11 @@
 
 	public static boolean isKnownRemote(final String remoteAddress) {
 		boolean isKnown = false;
+		System.out.print(remoteAddress + "\n");
+		if (remoteAddress.startsWith(IPv4_LOCALHOST) || remoteAddress.startsWith(IPv6_LOCALHOST) || remoteAddress.startsWith(IPv6_LOCALHOST_ALT)) {
+			// localhost
+			isKnown = true;
+		}
 		if (remoteAddress.startsWith(IPv6_PREFIX_HS) || remoteAddress.startsWith(IPv6_PREFIX_HS_ALT)) {
 			// Hostsharing IPv6
 			isKnown = true;

--
Gitblit v1.9.0-SNAPSHOT