|
|
|
@ -32,18 +32,19 @@ public final class BlacklistHelper {
|
|
|
|
|
final RequestHeader header) {
|
|
|
|
|
String newEntry = entry;
|
|
|
|
|
|
|
|
|
|
String location = null;
|
|
|
|
|
if (blacklistToUse == null || blacklistToUse.isEmpty()) {
|
|
|
|
|
return "";
|
|
|
|
|
location = header.getPathInfo();
|
|
|
|
|
} else if (newEntry == null || newEntry.isEmpty()) {
|
|
|
|
|
location = header.getPathInfo() + "?selectList=&selectedListName=" + blacklistToUse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (newEntry == null || newEntry.isEmpty()) {
|
|
|
|
|
return header.getPathInfo() + "?selectList=&selectedListName=" + blacklistToUse;
|
|
|
|
|
if(location != null) {
|
|
|
|
|
if(location.startsWith("/")) {
|
|
|
|
|
/* Remove the starting "/" to redirect to a relative location for easier reverse proxy integration */
|
|
|
|
|
location = location.substring(1, location.length() -1 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ignore empty entries
|
|
|
|
|
if(newEntry == null || newEntry.isEmpty()) {
|
|
|
|
|
ConcurrentLog.warn(APP_NAME, "skipped adding an empty entry");
|
|
|
|
|
return "";
|
|
|
|
|
return location;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (newEntry.startsWith("http://") ){
|
|
|
|
@ -99,12 +100,19 @@ public final class BlacklistHelper {
|
|
|
|
|
final RequestHeader header) {
|
|
|
|
|
String oldEntry = entry;
|
|
|
|
|
|
|
|
|
|
String location = null;
|
|
|
|
|
if (blacklistToUse == null || blacklistToUse.isEmpty()) {
|
|
|
|
|
return "";
|
|
|
|
|
location = header.getPathInfo();
|
|
|
|
|
} else if (oldEntry == null || oldEntry.isEmpty()) {
|
|
|
|
|
location = header.getPathInfo() + "?selectList=&selectedListName=" + blacklistToUse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (oldEntry == null || oldEntry.isEmpty()) {
|
|
|
|
|
return header.getPathInfo() + "?selectList=&selectedListName=" + blacklistToUse;
|
|
|
|
|
if(location != null) {
|
|
|
|
|
if(location.startsWith("/")) {
|
|
|
|
|
/* Remove the starting "/" to redirect to a relative location for easier reverse proxy integration */
|
|
|
|
|
location = location.substring(1, location.length() -1 );
|
|
|
|
|
}
|
|
|
|
|
return location;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|