public class CORSHelper extends Object
Constructor and Description |
---|
CORSHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
getAllowedOrigins(String origin,
Set<String> allowedOrigins)
Function to retrieve allowed origin header string
|
static void |
handleCORSHeaders(CORSConfiguration corsConfiguration,
MessageContext synCtx,
String supportedMethods,
boolean updateHeaders)
Functions to handle CORS Headers
|
static void |
handleCORSHeadersForResponse(CORSConfiguration corsConfiguration,
MessageContext synCtx)
Function to set CORS headers to response message transport headers extracting from synapse message context
|
public static String getAllowedOrigins(String origin, Set<String> allowedOrigins)
origin
- Received originallowedOrigins
- allowed origin setpublic static void handleCORSHeaders(CORSConfiguration corsConfiguration, MessageContext synCtx, String supportedMethods, boolean updateHeaders)
synCtx
- Synapse message contextcorsConfiguration
- of the APIsupportedMethods
- updateHeaders
- Booleanpublic static void handleCORSHeadersForResponse(CORSConfiguration corsConfiguration, MessageContext synCtx)
synCtx
- corsConfiguration
- of the APICopyright © 2005–2019 Apache Software Foundation. All rights reserved.