Interface CorsHandlerHelper

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ALLOW_CREDENTIALS_HEADER
      Name of the Access-Control-Allow-Credentials HTTP header.
      static java.lang.String ALLOW_HEADERS_HEADER
      Name of the Access-Control-Allow-Headers HTTP header.
      static java.lang.String ALLOW_METHODS_HEADER
      Name of the Access-Control-Allow-Methods HTTP header.
      static java.lang.String ALLOW_ORIGIN_HEADER
      Name of the Access-Control-Allow-Origin HTTP header.
      static java.lang.String EXPOSE_HEADERS_HEADER
      Name of the Access-Control-Expose-Headers HTTP header.
      static java.lang.String MAX_AGE_HEADER
      Name of the Access-Control-Max-Age HTTP header.
      static java.lang.String OPTIONS_METHOD
      OPTIONS HTTP method name.
      static java.lang.String ORIGIN_HEADER
      Name of the Origin HTTP header.
      static java.lang.String ORIGIN_WILDCARD
      The CORS Origin wildcard.
      static java.lang.String REQUEST_HEADERS_HEADER
      Name of the Access-Control-Request-Headers HTTP header.
      static java.lang.String VARY_HEADER
      Name of the Vary HTTP header.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void addValueToVaryHeader​(javax.servlet.http.HttpServletResponse response, java.lang.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, java.lang.String value)
      Sets the Access-Control-Allow-Origin HTTP header with a given value.
      java.util.Optional<java.lang.String> getAllowedOrigin​(javax.servlet.http.HttpServletRequest request)
      Returns the origin of this requests, if it's allowed.
      java.util.Optional<java.lang.String> getOrigin​(javax.servlet.http.HttpServletRequest request)
      Returns the value of the Origin HTTP header.
      java.lang.String 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.