Class CORSConfiguration


  • public class CORSConfiguration
    extends Object
    Configuration for CORS headers.
    • Constructor Detail

      • CORSConfiguration

        public CORSConfiguration()
    • Method Detail

      • getEnabled

        public boolean getEnabled()
        Get whether CORS has been enabled.
        Returns:
        true if CORS is enabled; false otherwise
      • setEnabled

        public void setEnabled​(boolean enabled)
        Enable or disable CORS.
        Parameters:
        enabled - true if CORS is enabled; false otherwise
      • getAllowOrigin

        public List<String> getAllowOrigin()
        Get a list of allowed origins.
        Returns:
        the Allow-Origin values
      • setAllowOrigin

        public void setAllowOrigin​(List<String> origins)
        Set the allowed origins.
        Parameters:
        origins - the origins
      • getAllowMethods

        public List<String> getAllowMethods()
        Get a list of allowed methods.
        Returns:
        the Allow-Methods values
      • setAllowMethods

        public void setAllowMethods​(List<String> methods)
        Set the allowed methods.
        Parameters:
        methods - the methods
      • getAllowHeaders

        public List<String> getAllowHeaders()
        Get a list of allowed headers.
        Returns:
        the Allow-Headers values
      • setAllowHeaders

        public void setAllowHeaders​(List<String> headers)
        Set the allowed headers.
        Parameters:
        headers - the allowed headers
      • getExposeHeaders

        public List<String> getExposeHeaders()
        Get a list of exposed headers.
        Returns:
        the Expose-Header values
      • setExposeHeaders

        public void setExposeHeaders​(List<String> headers)
        Set the exposed headers.
        Parameters:
        headers - the exposed headers
      • getMaxAge

        public int getMaxAge()
        Get the Max-Age header.
        Returns:
        the Max-Age header
      • setMaxAge

        public void setMaxAge​(int maxAge)
        Set the Max-Age header.
        Parameters:
        maxAge - the max age
      • getAllowCredentials

        public boolean getAllowCredentials()
        Get the value of Allow-Credentials.
        Returns:
        true if Allow-Credentials is set; false otherwise
      • setAllowCredentials

        public void setAllowCredentials​(boolean allowCredentials)
        Control whether Allow-Credentials should be displayed.
        Parameters:
        allowCredentials - true if Allow-Credentials should be included; false otherwise