Interface ResponseMarshaler.Builder.CorsAllowedHandler

Enclosing class:
ResponseMarshaler.Builder
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

  • Method Details

    • handle

      Applies "CORS is permitted for this request" data to a response.

      Invoked for any non-preflight CORS request that your CorsAuthorizer approves.

      This method will normally return a copy of the marshaledResponse with these headers applied based on the values of corsResponse:

      • Access-Control-Allow-Origin (required)
      • Access-Control-Allow-Credentials (optional)
      • Access-Control-Expose-Headers (optional)
      Parameters:
      request - the HTTP request
      cors - the CORS request data
      corsResponse - CORS response data to write as specified by CorsAuthorizer
      marshaledResponse - the existing response to which we should apply relevant CORS headers
      Returns:
      the response to be sent over the wire