Merge pull request #997 from rradillen/DS-2299

DS-2299 useProxies and X-Forwarded-FOR
This commit is contained in:
Tim Donohue
2017-03-15 14:18:19 -05:00
committed by GitHub
3 changed files with 15 additions and 2 deletions

View File

@@ -287,6 +287,9 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
}
}
}
if (!isUseProxies() && request.getHeader("X-Forwarded-For") != null){
log.warn("X-Forwarded-For header detected but useProxies is not enabled. If your dspace is behind a proxy set it to true");
}
doc1.addField("ip", ip);
@@ -366,7 +369,9 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
SolrInputDocument doc1 = new SolrInputDocument();
// Save our basic info that we already have
if (!isUseProxies() && xforwardedfor != null){
log.warn("X-Forwarded-For header detected but useProxies is not enabled. If your dspace is behind a proxy set it to true");
}
if (isUseProxies() && xforwardedfor != null) {
/* This header is a comma delimited list */
for (String xfip : xforwardedfor.split(",")) {