Package org.apache.wiki.http.filter
Class ForwardedHeaderFilter
java.lang.Object
org.apache.wiki.http.filter.ForwardedHeaderFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
see JSPWIKI-1289 and JSPWIKI-1294
This can be configured either via web.xml using the init parameters
(trustedProxies, allowedHosts) or in jspwiki-custom.properties
(forwarded.trustedProxies and forwarded.allowedHosts).
Used for providing security filtering for when jspwiki is behind a reverse
proxy and providing some security checks on inbound http headers.
Trust Proxies can either be ip addresses, ip address range via CIDR notation,
or hostnames. This would be the ip address/hostnames of your reverse proxy
(httpd/nginx/etc)
Allowed Hosts is the public facing URL/hostname. i.e. wiki.apache.org or
whatever.
If both checks do not pass, inbound http headers related to forwarded by are
dropped from further processing.
If neither is defined, it will default to a secure default setting, meaning
all x forwarded by headers are dropped/ignored
- Since:
- 3.0.1, 2.12.6
-
Constructor Details
-
ForwardedHeaderFilter
public ForwardedHeaderFilter()
-
-
Method Details
-
init
- Specified by:
initin interfacejakarta.servlet.Filter
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilterin interfacejakarta.servlet.Filter- Throws:
IOExceptionjakarta.servlet.ServletException
-