Package org.codelibs.fess.cors
Class DefaultCorsHandler
java.lang.Object
org.codelibs.fess.cors.CorsHandler
org.codelibs.fess.cors.DefaultCorsHandler
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.
-
Field Summary
Fields inherited from class org.codelibs.fess.cors.CorsHandler
ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK, ACCESS_CONTROL_MAX_AGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprocess(String origin, jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) Processes the CORS request by adding standard CORS headers to the response.voidregister()Registers this CORS handler with the factory for configured allowed origins.
-
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, jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) Processes the CORS request by adding standard CORS headers to the response. Headers include allowed origin, methods, headers, max age, and credentials setting.- Specified by:
processin classCorsHandler- Parameters:
origin- the origin of the requestrequest- the servlet requestresponse- the servlet response to add CORS headers to
-