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.
Function used to support pluggable implementations of
ResponseMarshaler.forCorsAllowed(Request, Cors, CorsResponse, MarshaledResponse).- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionhandle(Request request, Cors cors, CorsResponse corsResponse, MarshaledResponse marshaledResponse) Applies "CORS is permitted for this request" data to a response.
-
Method Details
-
handle
@Nonnull MarshaledResponse handle(@Nonnull Request request, @Nonnull Cors cors, @Nonnull CorsResponse corsResponse, @Nonnull MarshaledResponse marshaledResponse) Applies "CORS is permitted for this request" data to a response.Invoked for any non-preflight CORS request that your
CorsAuthorizerapproves.This method will normally return a copy of the
marshaledResponsewith these headers applied based on the values ofcorsResponse:Access-Control-Allow-Origin(required)Access-Control-Allow-Credentials(optional)Access-Control-Expose-Headers(optional)
- Parameters:
request- the HTTP requestcors- the CORS request datacorsResponse- CORS response data to write as specified byCorsAuthorizermarshaledResponse- the existing response to which we should apply relevant CORS headers- Returns:
- the response to be sent over the wire
-