Class CORSFilter

java.lang.Object
org.openremote.container.web.file.HttpFilter
org.openremote.container.security.CORSFilter
All Implemented Interfaces:
javax.servlet.Filter

public class CORSFilter extends HttpFilter
  • Field Details

    • allowCredentials

      protected boolean allowCredentials
    • allowedMethods

      protected String allowedMethods
    • allowedHeaders

      protected String allowedHeaders
    • exposedHeaders

      protected String exposedHeaders
    • corsMaxAge

      protected int corsMaxAge
    • allowedOrigins

      protected Set<String> allowedOrigins
  • Constructor Details

    • CORSFilter

      public CORSFilter()
  • Method Details

    • isAllowCredentials

      public boolean isAllowCredentials()
    • setAllowCredentials

      public void setAllowCredentials(boolean allowCredentials)
    • getAllowedMethods

      public String getAllowedMethods()
    • setAllowedMethods

      public void setAllowedMethods(String allowedMethods)
    • getAllowedHeaders

      public String getAllowedHeaders()
    • setAllowedHeaders

      public void setAllowedHeaders(String allowedHeaders)
    • getExposedHeaders

      public String getExposedHeaders()
    • setExposedHeaders

      public void setExposedHeaders(String exposedHeaders)
    • getCorsMaxAge

      public int getCorsMaxAge()
    • setCorsMaxAge

      public void setCorsMaxAge(int corsMaxAge)
    • getAllowedOrigins

      public Set<String> getAllowedOrigins()
    • setAllowedOrigins

      public void setAllowedOrigins(Set<String> allowedOrigins)
    • init

      public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
      Description copied from class: HttpFilter
      Called by the servlet container when the filter is about to be placed into service. This implementation stores the FilterConfig object for later use by the getter methods. It's recommended to not override this method. Instead, just use HttpFilter.init() method. When overriding this method anyway, don't forget to call super.init(config), otherwise the getter methods will throw an illegal state exception.
      Specified by:
      init in interface javax.servlet.Filter
      Overrides:
      init in class HttpFilter
      Throws:
      javax.servlet.ServletException
    • doFilter

      public void doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, IOException
      Description copied from class: HttpFilter
      Filter the HTTP request. The session argument is null if there is no session.
      Specified by:
      doFilter in class HttpFilter
      Parameters:
      request - The HTTP request.
      response - The HTTP response.
      session - The HTTP session, if any, else null.
      chain - The filter chain to continue.
      Throws:
      javax.servlet.ServletException - As wrapper exception when something fails in the request processing.
      IOException - Whenever something fails at I/O level.
      See Also:
      • Filter.doFilter(ServletRequest, ServletResponse, FilterChain)
    • destroy

      public void destroy()
      Specified by:
      destroy in interface javax.servlet.Filter
      Overrides:
      destroy in class HttpFilter
    • originOk

      protected boolean originOk(String origin)