Class CorsHandler

java.lang.Object
org.codelibs.fess.cors.CorsHandler
Direct Known Subclasses:
DefaultCorsHandler

public abstract class CorsHandler extends Object
Abstract base class for handling CORS (Cross-Origin Resource Sharing) requests. Provides common CORS header constants and defines the processing interface.
  • Field Details

    • ACCESS_CONTROL_ALLOW_ORIGIN

      protected static final String ACCESS_CONTROL_ALLOW_ORIGIN
      CORS header for specifying allowed origin.
      See Also:
    • ACCESS_CONTROL_ALLOW_HEADERS

      protected static final String ACCESS_CONTROL_ALLOW_HEADERS
      CORS header for specifying allowed headers.
      See Also:
    • ACCESS_CONTROL_ALLOW_METHODS

      protected static final String ACCESS_CONTROL_ALLOW_METHODS
      CORS header for specifying allowed HTTP methods.
      See Also:
    • ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK

      protected static final String ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK
      CORS header for allowing private network access.
      See Also:
    • ACCESS_CONTROL_ALLOW_CREDENTIALS

      protected static final String ACCESS_CONTROL_ALLOW_CREDENTIALS
      CORS header for allowing credentials.
      See Also:
    • ACCESS_CONTROL_MAX_AGE

      protected static final String ACCESS_CONTROL_MAX_AGE
      CORS header for specifying cache duration for preflight requests.
      See Also:
  • Constructor Details

    • CorsHandler

      public CorsHandler()
      Creates a new instance of CorsHandler.
  • Method Details

    • process

      public abstract void process(String origin, jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response)
      Processes the CORS request by setting appropriate headers.
      Parameters:
      origin - the origin of the request
      request - the servlet request
      response - the servlet response