mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 21:43:11 +00:00
Merge pull request #997 from rradillen/DS-2299
DS-2299 useProxies and X-Forwarded-FOR
This commit is contained in:
@@ -216,6 +216,10 @@ public class ElasticSearchLoggerServiceImpl implements ElasticSearchLoggerServic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
|
||||||
XContentBuilder docBuilder = null;
|
XContentBuilder docBuilder = null;
|
||||||
|
|
||||||
|
|
||||||
@@ -334,6 +338,10 @@ public class ElasticSearchLoggerServiceImpl implements ElasticSearchLoggerServic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
|
||||||
XContentBuilder docBuilder = null;
|
XContentBuilder docBuilder = null;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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);
|
doc1.addField("ip", ip);
|
||||||
|
|
||||||
@@ -366,7 +369,9 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
SolrInputDocument doc1 = new SolrInputDocument();
|
SolrInputDocument doc1 = new SolrInputDocument();
|
||||||
// Save our basic info that we already have
|
// 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) {
|
if (isUseProxies() && xforwardedfor != null) {
|
||||||
/* This header is a comma delimited list */
|
/* This header is a comma delimited list */
|
||||||
for (String xfip : xforwardedfor.split(",")) {
|
for (String xfip : xforwardedfor.split(",")) {
|
||||||
|
@@ -336,7 +336,7 @@ http.proxy.port =
|
|||||||
|
|
||||||
# If enabled, the logging and the Solr statistics system will look for
|
# If enabled, the logging and the Solr statistics system will look for
|
||||||
# an X-Forwarded-For header. If it finds it, it will use this for the user IP address
|
# an X-Forwarded-For header. If it finds it, it will use this for the user IP address
|
||||||
#useProxies = true
|
useProxies = false
|
||||||
|
|
||||||
#### Media Filter / Format Filter plugins (through PluginService) ####
|
#### Media Filter / Format Filter plugins (through PluginService) ####
|
||||||
# Media/Format Filters help to full-text index content or
|
# Media/Format Filters help to full-text index content or
|
||||||
|
Reference in New Issue
Block a user