Interface CorsHandlerHelper

All Known Implementing Classes:
CorsHandlerHelperImpl

public interface CorsHandlerHelper
Service that provides useful methods for CorsHandler implementations.
Since:
5.8.2
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of the Access-Control-Allow-Credentials HTTP header.
    static final String
    Name of the Access-Control-Allow-Headers HTTP header.
    static final String
    Name of the Access-Control-Allow-Methods HTTP header.
    static final String
    Name of the Access-Control-Allow-Origin HTTP header.
    static final String
    Name of the Access-Control-Expose-Headers HTTP header.
    static final String
    Name of the Access-Control-Max-Age HTTP header.
    static final String
    OPTIONS HTTP method name.
    static final String
    Name of the Origin HTTP header.
    static final String
    The CORS Origin wildcard.
    static final String
    Name of the Access-Control-Request-Headers HTTP header.
    static final String
    Name of the Vary HTTP header.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addValueToVaryHeader(javax.servlet.http.HttpServletResponse response, String value)
    Adds a value to the Vary HTTP header.
    void
    configureAllowedHeaders(javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
    Conditionally the Access-Control-Request-Headers HTTP header.
    void
    configureCredentials(javax.servlet.http.HttpServletResponse response)
    Conditionally sets the Access-Control-Allow-Credentials HTTP header.
    void
    configureExposeHeaders(javax.servlet.http.HttpServletResponse response)
    Conditionally sets the Access-Control-Expose-Headers HTTP header.
    void
    configureMaxAge(javax.servlet.http.HttpServletResponse response)
    Conditionally sets the Access-Control-Max-Age HTTP header.
    void
    configureMethods(javax.servlet.http.HttpServletResponse response)
    Conditionally sets the Access-Control-Allow-Methods HTTP header in responses to preflight CORS requests.
    void
    configureOrigin(javax.servlet.http.HttpServletResponse response, String value)
    Sets the Access-Control-Allow-Origin HTTP header with a given value.
    getAllowedOrigin(javax.servlet.http.HttpServletRequest request)
    Returns the origin of this requests, if it's allowed.
    getOrigin(javax.servlet.http.HttpServletRequest request)
    Returns the value of the Origin HTTP header.
    getPath(javax.servlet.http.HttpServletRequest request)
    Returns the requested URL path, using the same logic as Request.getPath().
    boolean
    isPreflight(javax.servlet.http.HttpServletRequest request)
    Tells whether this request is a CORS preflight one (i.e.