Class ForwardedHeaderFilter

java.lang.Object
org.apache.wiki.http.filter.ForwardedHeaderFilter
All Implemented Interfaces:
jakarta.servlet.Filter

public class ForwardedHeaderFilter extends Object implements 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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain)
     
    void
    init(jakarta.servlet.FilterConfig filterConfig)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jakarta.servlet.Filter

    destroy
  • Constructor Details

  • Method Details

    • init

      public void init(jakarta.servlet.FilterConfig filterConfig)
      Specified by:
      init in interface jakarta.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:
      doFilter in interface jakarta.servlet.Filter
      Throws:
      IOException
      jakarta.servlet.ServletException