Class DefaultCorsHandler

java.lang.Object
org.codelibs.fess.cors.CorsHandler
org.codelibs.fess.cors.DefaultCorsHandler

public class DefaultCorsHandler extends CorsHandler
Default implementation of CORS (Cross-Origin Resource Sharing) handler. This handler automatically registers itself for origins configured in the system and applies standard CORS headers based on the application configuration.
  • Constructor Details

    • DefaultCorsHandler

      public DefaultCorsHandler()
      Creates a new instance of DefaultCorsHandler. This constructor initializes the default CORS handler for applying standard CORS headers based on application configuration.
  • Method Details

    • register

      @PostConstruct public void register()
      Registers this CORS handler with the factory for configured allowed origins. This method is automatically called after bean initialization.
    • process

      public void process(String origin, CorsMatchType matchType, jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response)
      Processes the CORS request by setting standard CORS headers on the response. For an EXACT origin match the request Origin is reflected and credentials may be sent; for a WILDCARD match a literal "*" is returned and credentials are never sent.
      Specified by:
      process in class CorsHandler
      Parameters:
      origin - the origin of the request
      matchType - how the origin matched the allow list
      request - the servlet request
      response - the servlet response to add CORS headers to