This handler can be configured using one or more CorsConfig, please
refer to this class for details about the configuration options available.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private CorsConfig | |
| private final List | |
| private final boolean | |
| private static final InternalLogger | |
| private static final String | |
| private HttpRequest |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CorsHandler(final List<CorsConfig>
List of configList, boolean CorsConfigSame as isShortCircuit)CorsConfig#isShortCircuit but applicable to all supplied configs.Creates a new instance with the specified config list. |
| Modifier and Type | Method and Description |
|---|---|
| public void | channelRead(final ChannelHandlerContext ctx, final Object msg)
Overrides default io. Channel has read a message from the peer.
|
| private void | |
| private static void | |
| private CorsConfig | |
| private void | |
| private static boolean | |
| private static void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private static void | |
| private void | |
| private void | |
| private static void | |
| private boolean | |
| private static void | |
| private void | setPreflightHeaders(final HttpResponse
the HttpResponse to which the preflight response headers should be added. response)This is a non CORS specification feature which enables the setting of preflight response headers that might be required by intermediaries. |
| private static void | |
| private static CharSequence | |
| public Future | write(final ChannelHandlerContext
the ctx, final Object ChannelHandlerContext for which the write operation is madethe message to write msg)Overrides default io. |
| ANY_ORIGIN | back to summary |
|---|---|
| private static final String ANY_ORIGIN | |
| config | back to summary |
|---|---|
| private CorsConfig config | |
| configList | back to summary |
|---|---|
| private final List<CorsConfig> configList | |
| isShortCircuit | back to summary |
|---|---|
| private final boolean isShortCircuit | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| NULL_ORIGIN | back to summary |
|---|---|
| private static final String NULL_ORIGIN | |
| request | back to summary |
|---|---|
| private HttpRequest request | |
| CorsHandler | back to summary |
|---|---|
| public CorsHandler(final CorsConfig config) Creates a new instance with a single | |
| CorsHandler | back to summary |
|---|---|
| public CorsHandler(final List<CorsConfig> configList, boolean isShortCircuit) Creates a new instance with the specified config list. If more than one config matches a certain origin, the first in the List will be used.
| |
| channelRead | back to summary |
|---|---|
| public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception Overrides default io. Doc from io. Invoked when the current
| |
| echoRequestOrigin | back to summary |
|---|---|
| private void echoRequestOrigin(final HttpResponse response) | |
| forbidden | back to summary |
|---|---|
| private static void forbidden(final ChannelHandlerContext ctx, final HttpRequest request) throws Exception | |
| getForOrigin | back to summary |
|---|---|
| private CorsConfig getForOrigin(CharSequence requestOrigin) | |
| handlePreflight | back to summary |
|---|---|
| private void handlePreflight(final ChannelHandlerContext ctx, final HttpRequest request) throws Exception | |
| isPreflightRequest | back to summary |
|---|---|
| private static boolean isPreflightRequest(final HttpRequest request) | |
| respond | back to summary |
|---|---|
| private static void respond(final ChannelHandlerContext ctx, final HttpRequest request, final HttpResponse response) | |
| setAllowCredentials | back to summary |
|---|---|
| private void setAllowCredentials(final HttpResponse response) | |
| setAllowHeaders | back to summary |
|---|---|
| private void setAllowHeaders(final HttpResponse response) | |
| setAllowMethods | back to summary |
|---|---|
| private void setAllowMethods(final HttpResponse response) | |
| setAllowPrivateNetwork | back to summary |
|---|---|
| private void setAllowPrivateNetwork(final HttpResponse response) | |
| setAnyOrigin | back to summary |
|---|---|
| private static void setAnyOrigin(final HttpResponse response) | |
| setExposeHeaders | back to summary |
|---|---|
| private void setExposeHeaders(final HttpResponse response) | |
| setMaxAge | back to summary |
|---|---|
| private void setMaxAge(final HttpResponse response) | |
| setNullOrigin | back to summary |
|---|---|
| private static void setNullOrigin(final HttpResponse response) | |
| setOrigin | back to summary |
|---|---|
| private boolean setOrigin(final HttpResponse response) | |
| setOrigin | back to summary |
|---|---|
| private static void setOrigin(final HttpResponse response, final CharSequence origin) | |
| setPreflightHeaders | back to summary |
|---|---|
| private void setPreflightHeaders(final HttpResponse response) This is a non CORS specification feature which enables the setting of preflight response headers that might be required by intermediaries.
| |
| setVaryHeader | back to summary |
|---|---|
| private static void setVaryHeader(final HttpResponse response) | |
| toCsv | back to summary |
|---|---|
| private static CharSequence toCsv(Iterable<?> headerValues) | |
| write | back to summary |
|---|---|
| public Future Overrides default io. Doc from io. Called once a write operation is made. The write operation will write the messages through the
| |