Class CorsFilter

    • Constructor Detail

      • CorsFilter

        public CorsFilter()
    • Method Detail

      • doFilterInternal

        public void doFilterInternal​(javax.servlet.http.HttpServletRequest req,
                                     javax.servlet.http.HttpServletResponse res,
                                     javax.servlet.FilterChain chain)
                              throws IOException,
                                     javax.servlet.ServletException
        Specified by:
        doFilterInternal in class OncePerRequestFilter
        Throws:
        IOException
        javax.servlet.ServletException
      • setAllowedOrigins

        public void setAllowedOrigins​(String allowedOrigins)
        Set the allowed origins of a CORS request.

        Use a wildcard "*" to allow all.

      • setAllowedMethods

        public void setAllowedMethods​(@Nullable
                                      String allowedMethods)
        Set the allowed methods by a CORS request.

        Use a wildcard "*" to allow all.

      • setAllowedHeaders

        public void setAllowedHeaders​(@Nullable
                                      String allowedHeaders)
        Set the allowed headers by a CORS request.

        Use a wildcard "*" to allow all.