public abstract class HttpDecoderSpec<T extends HttpDecoderSpec<T>> extends Object implements Supplier<T>
HttpCodec
(or more precisely
the settings for the decoder).Modifier and Type | Field and Description |
---|---|
protected boolean |
allowDuplicateContentLengths |
protected boolean |
allowPartialChunks |
static boolean |
DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHS |
static boolean |
DEFAULT_ALLOW_PARTIAL_CHUNKS |
static int |
DEFAULT_INITIAL_BUFFER_SIZE |
static int |
DEFAULT_MAX_CHUNK_SIZE
Deprecated.
as of 1.1.0. This will be removed in 2.0.0 as Netty 5 does not support this configuration.
|
static int |
DEFAULT_MAX_HEADER_SIZE |
static int |
DEFAULT_MAX_INITIAL_LINE_LENGTH |
static boolean |
DEFAULT_VALIDATE_HEADERS |
protected int |
h2cMaxContentLength |
protected int |
initialBufferSize |
protected int |
maxChunkSize |
protected int |
maxHeaderSize |
protected int |
maxInitialLineLength |
protected boolean |
validateHeaders |
Constructor and Description |
---|
HttpDecoderSpec() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowDuplicateContentLengths()
Return the configuration whether to allow duplicate
Content-Length headers. |
T |
allowDuplicateContentLengths(boolean allow)
Configure whether to allow duplicate
Content-Length headers. |
boolean |
allowPartialChunks()
Return the configuration whether chunks can be split into multiple messages, if their chunk size
exceeds the size of the input buffer.
|
T |
allowPartialChunks(boolean allowPartialChunks)
Configure whether chunks can be split into multiple messages, if their chunk size exceeds the size of the
input buffer.
|
boolean |
equals(Object o) |
int |
h2cMaxContentLength()
Return the configured maximum length of the content of the HTTP/2.0 clear-text upgrade request.
|
T |
h2cMaxContentLength(int h2cMaxContentLength)
Configure the maximum length of the content of the HTTP/2.0 clear-text upgrade request.
|
int |
hashCode() |
int |
initialBufferSize()
Return the configured initial buffer size for HTTP request decoding.
|
T |
initialBufferSize(int value)
Configure the initial buffer size for HTTP request decoding.
|
int |
maxChunkSize()
Deprecated.
as of 1.1.0. This will be removed in 2.0.0 as Netty 5 does not support this configuration.
|
T |
maxChunkSize(int value)
Deprecated.
as of 1.1.0. This will be removed in 2.0.0 as Netty 5 does not support this configuration.
|
int |
maxHeaderSize()
Return the configured maximum header size that can be decoded for the HTTP request.
|
T |
maxHeaderSize(int value)
Configure the maximum header size that can be decoded for the HTTP request.
|
int |
maxInitialLineLength()
Return the configured maximum length that can be decoded for the HTTP request's initial line.
|
T |
maxInitialLineLength(int value)
Configure the maximum length that can be decoded for the HTTP request's initial
line.
|
boolean |
validateHeaders()
Return the configuration whether to validate headers when decoding requests.
|
T |
validateHeaders(boolean validate)
Configure whether to validate headers when decoding requests.
|
public static final int DEFAULT_MAX_INITIAL_LINE_LENGTH
public static final int DEFAULT_MAX_HEADER_SIZE
@Deprecated public static final int DEFAULT_MAX_CHUNK_SIZE
public static final boolean DEFAULT_VALIDATE_HEADERS
public static final int DEFAULT_INITIAL_BUFFER_SIZE
public static final boolean DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHS
public static final boolean DEFAULT_ALLOW_PARTIAL_CHUNKS
protected int maxInitialLineLength
protected int maxHeaderSize
protected int maxChunkSize
protected boolean validateHeaders
protected int initialBufferSize
protected boolean allowDuplicateContentLengths
protected int h2cMaxContentLength
protected boolean allowPartialChunks
public T maxInitialLineLength(int value)
DEFAULT_MAX_INITIAL_LINE_LENGTH
.value
- the value for the maximum initial line length (strictly positive)public int maxInitialLineLength()
public T maxHeaderSize(int value)
DEFAULT_MAX_HEADER_SIZE
.value
- the value for the maximum header size (strictly positive)public int maxHeaderSize()
@Deprecated public T maxChunkSize(int value)
DEFAULT_MAX_CHUNK_SIZE
.value
- the value for the maximum chunk size (strictly positive)@Deprecated public int maxChunkSize()
public T validateHeaders(boolean validate)
DEFAULT_VALIDATE_HEADERS
.validate
- true to validate headers, false otherwisepublic boolean validateHeaders()
public T initialBufferSize(int value)
DEFAULT_INITIAL_BUFFER_SIZE
.value
- the initial buffer size to use (strictly positive)public int initialBufferSize()
public T allowDuplicateContentLengths(boolean allow)
Content-Length
headers. Defaults to
DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHS
which means that a message with duplicate
Content-Length
headers is rejected. When this is configured to true
,
duplicate Content-Length
headers are accepted only if they are all the same value, otherwise
such message is rejected. The duplicated Content-Length
headers are replaced with a single valid
Content-Length
header.allow
- true to allow duplicate Content-Length
headers with the same value, false otherwisepublic boolean allowDuplicateContentLengths()
Content-Length
headers.Content-Length
headerspublic T h2cMaxContentLength(int h2cMaxContentLength)
h2cMaxContentLength
specifies the maximum
length of the content of the upgrade request.h2cMaxContentLength
- the maximum length of the content of the upgrade requestpublic int h2cMaxContentLength()
public T allowPartialChunks(boolean allowPartialChunks)
DEFAULT_ALLOW_PARTIAL_CHUNKS
.allowPartialChunks
- set to false
to only allow sending whole chunks down the pipeline.public boolean allowPartialChunks()
Content-Length
headers