@Immutable public class LaxContentLengthStrategy extends Object implements ContentLengthStrategy
Content-Length
header values if the CoreProtocolPNames.STRICT_TRANSFER_ENCODING
parameter of the given message is not set or set to false
.
This class recognizes "chunked" and "identitiy" transfer-coding only.
The following parameters can be used to customize the behavior of this class:
CHUNKED, IDENTITY
Constructor and Description |
---|
LaxContentLengthStrategy()
Creates LaxContentLengthStrategy instance.
|
LaxContentLengthStrategy(int implicitLen)
Creates LaxContentLengthStrategy instance with the given length used per default
when content length is not explicitly specified in the message.
|
public LaxContentLengthStrategy(int implicitLen)
implicitLen
- implicit content length.public LaxContentLengthStrategy()
ContentLengthStrategy.IDENTITY
is used per default when content length is not explicitly specified in the message.public long determineLength(HttpMessage message) throws HttpException
ContentLengthStrategy
ContentLengthStrategy.IDENTITY
if the end of the
message will be delimited by the end of connection, or ContentLengthStrategy.CHUNKED
if the message is chunk codeddetermineLength
in interface ContentLengthStrategy
ContentLengthStrategy.IDENTITY
, or ContentLengthStrategy.CHUNKED
HttpException
- in case of HTTP protocol violationCopyright © 2005-2015 The Apache Software Foundation. All Rights Reserved.