Package org.elasticsearch.http
Class CorsHandler
java.lang.Object
org.elasticsearch.http.CorsHandler
public class CorsHandler
extends java.lang.Object
This file is forked from the https://netty.io project. In particular it combines the following three
files: io.netty.handler.codec.http.cors.CorsHandler, io.netty.handler.codec.http.cors.CorsConfig, and
io.netty.handler.codec.http.cors.CorsConfigBuilder.
It modifies the original netty code to operate on Elasticsearch http request/response abstractions.
Additionally, it removes CORS features that are not used by Elasticsearch.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CorsHandler.Config
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACCESS_CONTROL_ALLOW_CREDENTIALS
static java.lang.String
ACCESS_CONTROL_ALLOW_HEADERS
static java.lang.String
ACCESS_CONTROL_ALLOW_METHODS
static java.lang.String
ACCESS_CONTROL_ALLOW_ORIGIN
static java.lang.String
ACCESS_CONTROL_MAX_AGE
static java.lang.String
ACCESS_CONTROL_REQUEST_METHOD
static java.lang.String
ANY_ORIGIN
static java.lang.String
DATE
static java.lang.String
HOST
static java.lang.String
ORIGIN
static java.lang.String
VARY
-
Constructor Summary
Constructors Constructor Description CorsHandler(CorsHandler.Config config)
-
Method Summary
Modifier and Type Method Description static CorsHandler.Config
buildConfig(Settings settings)
static CorsHandler
disabled()
static CorsHandler
fromSettings(Settings settings)
HttpResponse
handleInbound(HttpRequest request)
void
setCorsResponseHeaders(HttpRequest httpRequest, HttpResponse httpResponse)
-
Field Details
-
ANY_ORIGIN
public static final java.lang.String ANY_ORIGIN- See Also:
- Constant Field Values
-
ORIGIN
public static final java.lang.String ORIGIN- See Also:
- Constant Field Values
-
DATE
public static final java.lang.String DATE- See Also:
- Constant Field Values
-
VARY
public static final java.lang.String VARY- See Also:
- Constant Field Values
-
HOST
public static final java.lang.String HOST- See Also:
- Constant Field Values
-
ACCESS_CONTROL_REQUEST_METHOD
public static final java.lang.String ACCESS_CONTROL_REQUEST_METHOD- See Also:
- Constant Field Values
-
ACCESS_CONTROL_ALLOW_HEADERS
public static final java.lang.String ACCESS_CONTROL_ALLOW_HEADERS- See Also:
- Constant Field Values
-
ACCESS_CONTROL_ALLOW_CREDENTIALS
public static final java.lang.String ACCESS_CONTROL_ALLOW_CREDENTIALS- See Also:
- Constant Field Values
-
ACCESS_CONTROL_ALLOW_METHODS
public static final java.lang.String ACCESS_CONTROL_ALLOW_METHODS- See Also:
- Constant Field Values
-
ACCESS_CONTROL_ALLOW_ORIGIN
public static final java.lang.String ACCESS_CONTROL_ALLOW_ORIGIN- See Also:
- Constant Field Values
-
ACCESS_CONTROL_MAX_AGE
public static final java.lang.String ACCESS_CONTROL_MAX_AGE- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details