Top Fields Constructors Methods
org.apache.coyote.http11

public abstract Class AbstractHttp11Protocol<S>

extends AbstractProtocol<S>
Class Inheritance
Known Direct Subclasses
org.apache.coyote.http11.AbstractHttp11JsseProtocol
Imports
java.util.ArrayList, .HashMap, .HashSet, .List, .Locale, .Map, .Set, java.util.concurrent.ConcurrentHashMap, java.util.regex.Pattern, javax.management.ObjectInstance, .ObjectName, jakarta.servlet.http.HttpServletRequest, .HttpUpgradeHandler, org.apache.coyote.AbstractProtocol, .CompressionConfig, .ContinueResponseTiming, .Processor, .Request, .Response, .UpgradeProtocol, .UpgradeToken, org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler, .UpgradeGroupInfo, .UpgradeProcessorExternal, .UpgradeProcessorInternal, org.apache.tomcat.util.buf.StringUtils, org.apache.tomcat.util.modeler.Registry, .Util, org.apache.tomcat.util.net.AbstractEndpoint, .SSLHostConfig, .SocketWrapperBase, org.apache.tomcat.util.res.StringManager

Field Summary

Modifier and TypeField and Description
private Set<String>
allowedTrailerHeaders

The names of headers that are allowed to be sent via a trailer when using chunked encoding.

private boolean
private final CompressionConfig
private int
private ContinueResponseTiming
private boolean
private final Map<String, UpgradeProtocol>
httpUpgradeProtocols

The protocols that are available via internal Tomcat support for access via HTTP upgrade.

private int
maxExtensionSize

Maximum size of extension information in chunked encoding

private int
maxHttpHeaderSize

Maximum size of the HTTP message header.

private int
maxHttpRequestHeaderSize

Maximum size of the HTTP request message header.

private int
maxHttpResponseHeaderSize

Maximum size of the HTTP response message header.

private int
private int
maxSwallowSize

Maximum amount of request body to swallow.

private int
maxTrailerSize

Maximum size of trailing headers in bytes

private final Map<String, UpgradeProtocol>
negotiatedProtocols

The protocols that are available via internal Tomcat support for access via ALPN negotiation.

private boolean
private String
private String
private Pattern
private boolean
secure

This field indicates if the protocol is treated as if it is secure.

private String
private boolean
protected static final StringManager
private final Map<String, UpgradeGroupInfo>
upgradeProtocolGroupInfos

Map of upgrade protocol name to UpgradeGroupInfo instance.

private final List<UpgradeProtocol>
upgradeProtocols

The upgrade protocol instances configured.

private boolean
Inherited from org.apache.coyote.AbstractProtocol:
adapterdomainmserveronameprocessorCachergOname

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
addSslHostConfig(SSLHostConfig
the configuration
sslHostConfig
)

Implements org.apache.coyote.ProtocolHandler.addSslHostConfig.

Add a new SSL configuration for a virtual host.

public void
addSslHostConfig(SSLHostConfig
the configuration
sslHostConfig
,
boolean
If true replacement of an existing configuration is permitted, otherwise any such attempted replacement will trigger an exception
replace
)

Implements org.apache.coyote.ProtocolHandler.addSslHostConfig.

Add a new SSL configuration for a virtual host.

public void
addUpgradeProtocol(UpgradeProtocol
the protocol
upgradeProtocol
)

Implements org.apache.coyote.ProtocolHandler.addUpgradeProtocol.

Add a new protocol for used by HTTP/1.1 upgrade or ALPN.

private void
protected Processor
createProcessor()

Implements abstract org.apache.coyote.AbstractProtocol.createProcessor.

Create and configure a new Processor instance for the current protocol implementation.

protected Processor
public void
destroy()

Overrides org.apache.coyote.AbstractProtocol.destroy.

Implements org.apache.coyote.ProtocolHandler.destroy.

Destroy the protocol (optional).

public SSLHostConfig[]
findSslHostConfigs()

Implements org.apache.coyote.ProtocolHandler.findSslHostConfigs.

Find all configured SSL virtual host configurations which will be used by SNI.

public UpgradeProtocol[]
findUpgradeProtocols()

Implements org.apache.coyote.ProtocolHandler.findUpgradeProtocols.

Return all configured upgrade protocols.

public String
protected Set<String>
public boolean

Returns:

true if Tomcat will allow such requests, otherwise false
getAllowHostHeaderMismatch
()
Deprecated This will removed in Tomcat 11 onwards where allowHostHeaderMismatch will be hard-coded to false.

Will Tomcat accept an HTTP 1.1 request where the host header does not agree with the host specified (if any) in the request line?

public String
public String[]
public String
protected int
public int
public int

Returns:

The timeout in milliseconds
getConnectionUploadTimeout
()

Specifies a different (usually longer) connection timeout during data upload.

public String
public ContinueResponseTiming
public String
public boolean

Returns:

true if the separate upload timeout is disabled
getDisableUploadTimeout
()

Get the flag that controls upload time-outs.

protected AbstractEndpoint<S, ?>
getEndpoint()

Overrides org.apache.coyote.AbstractProtocol.getEndpoint.

Over-ridden here to make the method visible to nested classes.

public int
public int
public int
public int
public int

Returns:

The maximum number of requests which can be performed over a keep-alive connection. The default is the same as for Apache HTTP Server (100).
getMaxKeepAliveRequests
()

public int

Returns:

The size in bytes
getMaxSavePostSize
()

Return the maximum size of the post which will be saved during FORM or CLIENT-CERT authentication.

public int
public int
public UpgradeProtocol
getNegotiatedProtocol(String
The name of the requested negotiated protocol.
negotiatedName
)

Implements abstract org.apache.coyote.AbstractProtocol.getNegotiatedProtocol.

Find a suitable handler for the protocol negotiated at the network layer.

public String
protected Pattern
public ObjectName
getONameForUpgrade(String upgradeProtocol)

protected String
getProtocolName()

Implements abstract org.apache.coyote.AbstractProtocol.getProtocolName.

Obtain the name of the protocol, (Http, Ajp, etc.).

public boolean

Returns:

true if the request will be rejected or false if the header will be ignored
getRejectIllegalHeader
()
Deprecated This will removed in Tomcat 11 onwards where allowHostHeaderMismatch will be hard-coded to true.

If an HTTP request is received that contains an illegal header name or value (e.g. the header name is not a token) will the request be rejected (with a 400 response) or will the illegal header be ignored?

public String
public String
public String

Returns:

The regular expression as a String
getRestrictedUserAgents
()

Get the string form of the regular expression that defines the User agents which should be restricted to HTTP/1.0 support.

protected Pattern
public boolean
public String
public boolean

Returns:

true if application provided values should be removed, otherwise false
getServerRemoveAppProvidedValues
()

Should application provider values for the HTTP Server header be removed.

public UpgradeGroupInfo
getUpgradeGroupInfo(String upgradeProtocol)

public UpgradeProtocol
getUpgradeProtocol(String
The name of the requested negotiated protocol.
upgradedName
)

Implements abstract org.apache.coyote.AbstractProtocol.getUpgradeProtocol.

Find a suitable handler for the protocol upgraded name specified.

public boolean
public boolean
public void
public boolean
public boolean
public void
public void
public void
public void
setAllowedTrailerHeaders(String commaSeparatedHeaders)

public void
setAllowHostHeaderMismatch(boolean
true to allow such requests, false to reject them with a 400
allowHostHeaderMismatch
)
Deprecated This will removed in Tomcat 11 onwards where allowHostHeaderMismatch will be hard-coded to false.

Will Tomcat accept an HTTP 1.1 request where the host header does not agree with the host specified (if any) in the request line?

public void
public void
setCompression(String compression)

public void
setCompressionMinSize(int compressionMinSize)

public void
setConnectionUploadTimeout(int
Upload timeout in milliseconds
timeout
)

Set the upload timeout.

public void
setContinueResponseTiming(String continueResponseTiming)

public void
setDefaultSSLHostConfigName(String defaultSSLHostConfigName)

public void
setDisableUploadTimeout(boolean
true if the separate upload timeout should be disabled
isDisabled
)

Set the flag to control whether a separate connection timeout is used during upload of a request body.

public void
setMaxExtensionSize(int maxExtensionSize)

public void
public void
public void
public void
setMaxKeepAliveRequests(int
The new maximum number of Keep-Alive requests allowed
mkar
)

Set the maximum number of Keep-Alive requests to allow.

public void
setMaxSavePostSize(int
The maximum size POST body to buffer in bytes
maxSavePostSize
)

Set the maximum size of a POST which will be buffered during FORM or CLIENT-CERT authentication.

public void
setMaxSwallowSize(int maxSwallowSize)

public void
setMaxTrailerSize(int maxTrailerSize)

public void
setNoCompressionUserAgents(String noCompressionUserAgents)

public void
setRejectIllegalHeader(boolean
true to reject requests with illegal header names or values, false to ignore the header
rejectIllegalHeader
)
Deprecated This will removed in Tomcat 11 onwards where allowHostHeaderMismatch will be hard-coded to true.

If an HTTP request is received that contains an illegal header name or value (e.g. the header name is not a token) should the request be rejected (with a 400 response) or should the illegal header be ignored?

public void
setRelaxedPathChars(String relaxedPathChars)

public void
setRelaxedQueryChars(String relaxedQueryChars)

public void
setRestrictedUserAgents(String
The regular expression as supported by Pattern for the user agents e.g. "gorilla|desesplorer|tigrus"
restrictedUserAgents
)

Set restricted user agent list (which will downgrade the connector to HTTP/1.0 mode).

public void
setSecure(boolean b)

public void
setServer(String
The new value to use for the server header
server
)

Set the server header name.

public void
setServerRemoveAppProvidedValues(boolean serverRemoveAppProvidedValues)

public void
setSSLEnabled(boolean SSLEnabled)

public void
setUseKeepAliveResponseHeader(boolean useKeepAliveResponseHeader)

public void
setUseSendfile(boolean useSendfile)

public boolean
useCompression(Request request, Response response)

Inherited from org.apache.coyote.AbstractProtocol:
addWaitingProcessorawaitConnectionsClosecloseServerSocketGracefulgetAcceptCountgetAcceptorThreadPrioritygetAdaptergetAddressgetClientCertProvidergetConnectionCountgetConnectionLingergetConnectionTimeoutgetDomaingetExecutorgetGlobalRequestProcessorMBeanNamegetHandlergetIdgetKeepAliveTimeoutgetLocalPortgetLoggetMaxConnectionsgetMaxHeaderCountgetMaxThreadsgetMinSpareThreadsgetNamegetNameIndexgetNamePrefixgetObjectNamegetPortgetPortOffsetgetPortWithOffsetgetProcessorCachegetPropertygetTcpNoDelaygetThreadPrioritygetUtilityExecutorgetWaitingProcessorCountisPausedisSendfileSupportedpausepostDeregisterpostRegisterpreDeregisterpreRegisterremoveWaitingProcessorresumesetAcceptCountsetAcceptorThreadPrioritysetAdaptersetAddresssetClientCertProvidersetConnectionLingersetConnectionTimeoutsetExecutorsetHandlersetKeepAliveTimeoutsetMaxConnectionssetMaxHeaderCountsetMaxThreadssetMinSpareThreadssetPortsetPortOffsetsetProcessorCachesetPropertysetTcpNoDelaysetThreadPrioritysetUtilityExecutorstartstartAsyncTimeoutstopstopAsyncTimeout

Field Detail

allowedTrailerHeadersback to summary
private Set<String> allowedTrailerHeaders

The names of headers that are allowed to be sent via a trailer when using chunked encoding. They are stored in lower case.

allowHostHeaderMismatchback to summary
private boolean allowHostHeaderMismatch
compressionConfigback to summary
private final CompressionConfig compressionConfig
connectionUploadTimeoutback to summary
private int connectionUploadTimeout
continueResponseTimingback to summary
private ContinueResponseTiming continueResponseTiming
disableUploadTimeoutback to summary
private boolean disableUploadTimeout
httpUpgradeProtocolsback to summary
private final Map<String, UpgradeProtocol> httpUpgradeProtocols

The protocols that are available via internal Tomcat support for access via HTTP upgrade.

maxExtensionSizeback to summary
private int maxExtensionSize

Maximum size of extension information in chunked encoding

maxHttpHeaderSizeback to summary
private int maxHttpHeaderSize

Maximum size of the HTTP message header.

maxHttpRequestHeaderSizeback to summary
private int maxHttpRequestHeaderSize

Maximum size of the HTTP request message header.

maxHttpResponseHeaderSizeback to summary
private int maxHttpResponseHeaderSize

Maximum size of the HTTP response message header.

maxSavePostSizeback to summary
private int maxSavePostSize
maxSwallowSizeback to summary
private int maxSwallowSize

Maximum amount of request body to swallow.

maxTrailerSizeback to summary
private int maxTrailerSize

Maximum size of trailing headers in bytes

negotiatedProtocolsback to summary
private final Map<String, UpgradeProtocol> negotiatedProtocols

The protocols that are available via internal Tomcat support for access via ALPN negotiation.

rejectIllegalHeaderback to summary
private boolean rejectIllegalHeader
relaxedPathCharsback to summary
private String relaxedPathChars
relaxedQueryCharsback to summary
private String relaxedQueryChars
restrictedUserAgentsback to summary
private Pattern restrictedUserAgents
secureback to summary
private boolean secure

This field indicates if the protocol is treated as if it is secure. This normally means https is being used but can be used to fake https e.g behind a reverse proxy.

serverback to summary
private String server
serverRemoveAppProvidedValuesback to summary
private boolean serverRemoveAppProvidedValues
smback to summary
protected static final StringManager sm

Hides org.apache.coyote.AbstractProtocol.sm.

upgradeProtocolGroupInfosback to summary
private final Map<String, UpgradeGroupInfo> upgradeProtocolGroupInfos

Map of upgrade protocol name to UpgradeGroupInfo instance.

HTTP upgrades via HttpServletRequest#upgrade(Class) do not have to depend on an UpgradeProtocol. To enable basic statistics to be made available for these protocols, a map of protocol name to UpgradeGroupInfo instances is maintained here.

upgradeProtocolsback to summary
private final List<UpgradeProtocol> upgradeProtocols

The upgrade protocol instances configured.

useKeepAliveResponseHeaderback to summary
private boolean useKeepAliveResponseHeader

Constructor Detail

AbstractHttp11Protocolback to summary
public AbstractHttp11Protocol(AbstractEndpoint<S, ?> endpoint)

Method Detail

addAllowedTrailerHeaderback to summary
public void addAllowedTrailerHeader(String header)
addSslHostConfigback to summary
public void addSslHostConfig(SSLHostConfig sslHostConfig)

Implements org.apache.coyote.ProtocolHandler.addSslHostConfig.

Doc from org.apache.coyote.ProtocolHandler.addSslHostConfig.

Add a new SSL configuration for a virtual host.

Parameters
sslHostConfig:SSLHostConfig

the configuration

Annotations
@Override
addSslHostConfigback to summary
public void addSslHostConfig(SSLHostConfig sslHostConfig, boolean replace)

Implements org.apache.coyote.ProtocolHandler.addSslHostConfig.

Doc from org.apache.coyote.ProtocolHandler.addSslHostConfig.

Add a new SSL configuration for a virtual host.

Parameters
sslHostConfig:SSLHostConfig

the configuration

replace:boolean

If true replacement of an existing configuration is permitted, otherwise any such attempted replacement will trigger an exception

Annotations
@Override
addUpgradeProtocolback to summary
public void addUpgradeProtocol(UpgradeProtocol upgradeProtocol)

Implements org.apache.coyote.ProtocolHandler.addUpgradeProtocol.

Doc from org.apache.coyote.ProtocolHandler.addUpgradeProtocol.

Add a new protocol for used by HTTP/1.1 upgrade or ALPN.

Parameters
upgradeProtocol:UpgradeProtocol

the protocol

Annotations
@Override
configureUpgradeProtocolback to summary
private void configureUpgradeProtocol(UpgradeProtocol upgradeProtocol)
createProcessorback to summary
protected Processor createProcessor()

Implements abstract org.apache.coyote.AbstractProtocol.createProcessor.

Doc from org.apache.coyote.AbstractProtocol.createProcessor.

Create and configure a new Processor instance for the current protocol implementation.

Returns:Processor

A fully configured Processor instance that is ready to use

Annotations
@Override
createUpgradeProcessorback to summary
protected Processor createUpgradeProcessor(SocketWrapperBase<?> socket, UpgradeToken upgradeToken)

Implements abstract org.apache.coyote.AbstractProtocol.createUpgradeProcessor.

Annotations
@Override
destroyback to summary
public void destroy() throws Exception

Overrides org.apache.coyote.AbstractProtocol.destroy.

Implements org.apache.coyote.ProtocolHandler.destroy.

Doc from org.apache.coyote.ProtocolHandler.destroy.

Destroy the protocol (optional).

Annotations
@Override
Exceptions
Exception:
If the protocol handler fails to destroy
findSslHostConfigsback to summary
public SSLHostConfig[] findSslHostConfigs()

Implements org.apache.coyote.ProtocolHandler.findSslHostConfigs.

Doc from org.apache.coyote.ProtocolHandler.findSslHostConfigs.

Find all configured SSL virtual host configurations which will be used by SNI.

Returns:SSLHostConfig[]

the configurations

Annotations
@Override
findUpgradeProtocolsback to summary
public UpgradeProtocol[] findUpgradeProtocols()

Implements org.apache.coyote.ProtocolHandler.findUpgradeProtocols.

Doc from org.apache.coyote.ProtocolHandler.findUpgradeProtocols.

Return all configured upgrade protocols.

Returns:UpgradeProtocol[]

the protocols

Annotations
@Override
getAllowedTrailerHeadersback to summary
public String getAllowedTrailerHeaders()
getAllowedTrailerHeadersInternalback to summary
protected Set<String> getAllowedTrailerHeadersInternal()
getAllowHostHeaderMismatchback to summary
public boolean getAllowHostHeaderMismatch()

Deprecated

This will removed in Tomcat 11 onwards where allowHostHeaderMismatch will be hard-coded to false.

Will Tomcat accept an HTTP 1.1 request where the host header does not agree with the host specified (if any) in the request line?

Returns:boolean

true if Tomcat will allow such requests, otherwise false

Annotations
@Deprecated
getCompressibleMimeTypeback to summary
public String getCompressibleMimeType()
getCompressibleMimeTypesback to summary
public String[] getCompressibleMimeTypes()
getCompressionback to summary
public String getCompression()
getCompressionLevelback to summary
protected int getCompressionLevel()
getCompressionMinSizeback to summary
public int getCompressionMinSize()
getConnectionUploadTimeoutback to summary
public int getConnectionUploadTimeout()

Specifies a different (usually longer) connection timeout during data upload. Default is 5 minutes as in Apache HTTPD server.

Returns:int

The timeout in milliseconds

getContinueResponseTimingback to summary
public String getContinueResponseTiming()
getContinueResponseTimingInternalback to summary
public ContinueResponseTiming getContinueResponseTimingInternal()
getDefaultSSLHostConfigNameback to summary
public String getDefaultSSLHostConfigName()
getDisableUploadTimeoutback to summary
public boolean getDisableUploadTimeout()

Get the flag that controls upload time-outs. If true, the connectionUploadTimeout will be ignored and the regular socket timeout will be used for the full duration of the connection.

Returns:boolean

true if the separate upload timeout is disabled

getEndpointback to summary
protected AbstractEndpoint<S, ?> getEndpoint()

Overrides org.apache.coyote.AbstractProtocol.getEndpoint.

Over-ridden here to make the method visible to nested classes.

Annotations
@Override
getMaxExtensionSizeback to summary
public int getMaxExtensionSize()
getMaxHttpHeaderSizeback to summary
public int getMaxHttpHeaderSize()
getMaxHttpRequestHeaderSizeback to summary
public int getMaxHttpRequestHeaderSize()
getMaxHttpResponseHeaderSizeback to summary
public int getMaxHttpResponseHeaderSize()
getMaxKeepAliveRequestsback to summary
public int getMaxKeepAliveRequests()
Returns:int

The maximum number of requests which can be performed over a keep-alive connection. The default is the same as for Apache HTTP Server (100).

getMaxSavePostSizeback to summary
public int getMaxSavePostSize()

Return the maximum size of the post which will be saved during FORM or CLIENT-CERT authentication.

Returns:int

The size in bytes

getMaxSwallowSizeback to summary
public int getMaxSwallowSize()
getMaxTrailerSizeback to summary
public int getMaxTrailerSize()
getNegotiatedProtocolback to summary
public UpgradeProtocol getNegotiatedProtocol(String negotiatedName)

Implements abstract org.apache.coyote.AbstractProtocol.getNegotiatedProtocol.

Doc from org.apache.coyote.AbstractProtocol.getNegotiatedProtocol.

Find a suitable handler for the protocol negotiated at the network layer.

Parameters
negotiatedName:String

The name of the requested negotiated protocol.

Returns:UpgradeProtocol

The instance where UpgradeProtocol#getAlpnName() matches the requested protocol

Annotations
@Override
getNoCompressionUserAgentsback to summary
public String getNoCompressionUserAgents()
getNoCompressionUserAgentsPatternback to summary
protected Pattern getNoCompressionUserAgentsPattern()
getONameForUpgradeback to summary
public ObjectName getONameForUpgrade(String upgradeProtocol)
getProtocolNameback to summary
protected String getProtocolName()

Implements abstract org.apache.coyote.AbstractProtocol.getProtocolName.

Doc from org.apache.coyote.AbstractProtocol.getProtocolName.

Obtain the name of the protocol, (Http, Ajp, etc.). Used with JMX.

Returns:String

the protocol name

Annotations
@Override
getRejectIllegalHeaderback to summary
public boolean getRejectIllegalHeader()

Deprecated

This will removed in Tomcat 11 onwards where allowHostHeaderMismatch will be hard-coded to true.

If an HTTP request is received that contains an illegal header name or value (e.g. the header name is not a token) will the request be rejected (with a 400 response) or will the illegal header be ignored?

Returns:boolean

true if the request will be rejected or false if the header will be ignored

Annotations
@Deprecated
getRelaxedPathCharsback to summary
public String getRelaxedPathChars()
getRelaxedQueryCharsback to summary
public String getRelaxedQueryChars()
getRestrictedUserAgentsback to summary
public String getRestrictedUserAgents()

Get the string form of the regular expression that defines the User agents which should be restricted to HTTP/1.0 support.

Returns:String

The regular expression as a String

getRestrictedUserAgentsPatternback to summary
protected Pattern getRestrictedUserAgentsPattern()
getSecureback to summary
public boolean getSecure()
getServerback to summary
public String getServer()
getServerRemoveAppProvidedValuesback to summary
public boolean getServerRemoveAppProvidedValues()

Should application provider values for the HTTP Server header be removed. Note that if server is set, any application provided value will be over-ridden.

Returns:boolean

true if application provided values should be removed, otherwise false

getUpgradeGroupInfoback to summary
public UpgradeGroupInfo getUpgradeGroupInfo(String upgradeProtocol)
getUpgradeProtocolback to summary
public UpgradeProtocol getUpgradeProtocol(String upgradedName)

Implements abstract org.apache.coyote.AbstractProtocol.getUpgradeProtocol.

Doc from org.apache.coyote.AbstractProtocol.getUpgradeProtocol.

Find a suitable handler for the protocol upgraded name specified. This is used for direct connection protocol selection.

Parameters
upgradedName:String

The name of the requested negotiated protocol.

Returns:UpgradeProtocol

The instance where UpgradeProtocol#getAlpnName() matches the requested protocol

Annotations
@Override
getUseKeepAliveResponseHeaderback to summary
public boolean getUseKeepAliveResponseHeader()
getUseSendfileback to summary
public boolean getUseSendfile()
initback to summary
public void init() throws Exception

Overrides org.apache.coyote.AbstractProtocol.init.

Implements org.apache.coyote.ProtocolHandler.init.

Doc from org.apache.coyote.ProtocolHandler.init.

Initialise the protocol.

Annotations
@Override
Exceptions
Exception:
If the protocol handler fails to initialise
isSSLEnabledback to summary
public boolean isSSLEnabled()
isTrailerHeaderAllowedback to summary
public boolean isTrailerHeaderAllowed(String headerName)
reloadSslHostConfigback to summary
public void reloadSslHostConfig(String hostName)
reloadSslHostConfigsback to summary
public void reloadSslHostConfigs()
removeAllowedTrailerHeaderback to summary
public void removeAllowedTrailerHeader(String header)
setAllowedTrailerHeadersback to summary
public void setAllowedTrailerHeaders(String commaSeparatedHeaders)
setAllowHostHeaderMismatchback to summary
public void setAllowHostHeaderMismatch(boolean allowHostHeaderMismatch)

Deprecated

This will removed in Tomcat 11 onwards where allowHostHeaderMismatch will be hard-coded to false.

Will Tomcat accept an HTTP 1.1 request where the host header does not agree with the host specified (if any) in the request line?

Parameters
allowHostHeaderMismatch:boolean

true to allow such requests, false to reject them with a 400

Annotations
@Deprecated
setCompressibleMimeTypeback to summary
public void setCompressibleMimeType(String valueS)
setCompressionback to summary
public void setCompression(String compression)
setCompressionMinSizeback to summary
public void setCompressionMinSize(int compressionMinSize)
setConnectionUploadTimeoutback to summary
public void setConnectionUploadTimeout(int timeout)

Set the upload timeout.

Parameters
timeout:int

Upload timeout in milliseconds

setContinueResponseTimingback to summary
public void setContinueResponseTiming(String continueResponseTiming)
setDefaultSSLHostConfigNameback to summary
public void setDefaultSSLHostConfigName(String defaultSSLHostConfigName)
setDisableUploadTimeoutback to summary
public void setDisableUploadTimeout(boolean isDisabled)

Set the flag to control whether a separate connection timeout is used during upload of a request body.

Parameters
isDisabled:boolean

true if the separate upload timeout should be disabled

setMaxExtensionSizeback to summary
public void setMaxExtensionSize(int maxExtensionSize)
setMaxHttpHeaderSizeback to summary
public void setMaxHttpHeaderSize(int valueI)
setMaxHttpRequestHeaderSizeback to summary
public void setMaxHttpRequestHeaderSize(int valueI)
setMaxHttpResponseHeaderSizeback to summary
public void setMaxHttpResponseHeaderSize(int valueI)
setMaxKeepAliveRequestsback to summary
public void setMaxKeepAliveRequests(int mkar)

Set the maximum number of Keep-Alive requests to allow. This is to safeguard from DoS attacks. Setting to a negative value disables the limit.

Parameters
mkar:int

The new maximum number of Keep-Alive requests allowed

setMaxSavePostSizeback to summary
public void setMaxSavePostSize(int maxSavePostSize)

Set the maximum size of a POST which will be buffered during FORM or CLIENT-CERT authentication. When a POST is received where the security constraints require a client certificate, the POST body needs to be buffered while an SSL handshake takes place to obtain the certificate. A similar buffering is required during FORM auth.

Parameters
maxSavePostSize:int

The maximum size POST body to buffer in bytes

setMaxSwallowSizeback to summary
public void setMaxSwallowSize(int maxSwallowSize)
setMaxTrailerSizeback to summary
public void setMaxTrailerSize(int maxTrailerSize)
setNoCompressionUserAgentsback to summary
public void setNoCompressionUserAgents(String noCompressionUserAgents)
setRejectIllegalHeaderback to summary
public void setRejectIllegalHeader(boolean rejectIllegalHeader)

Deprecated

This will removed in Tomcat 11 onwards where allowHostHeaderMismatch will be hard-coded to true.

If an HTTP request is received that contains an illegal header name or value (e.g. the header name is not a token) should the request be rejected (with a 400 response) or should the illegal header be ignored?

Parameters
rejectIllegalHeader:boolean

true to reject requests with illegal header names or values, false to ignore the header

Annotations
@Deprecated
setRelaxedPathCharsback to summary
public void setRelaxedPathChars(String relaxedPathChars)
setRelaxedQueryCharsback to summary
public void setRelaxedQueryChars(String relaxedQueryChars)
setRestrictedUserAgentsback to summary
public void setRestrictedUserAgents(String restrictedUserAgents)

Set restricted user agent list (which will downgrade the connector to HTTP/1.0 mode). Regular expression as supported by Pattern.

Parameters
restrictedUserAgents:String

The regular expression as supported by Pattern for the user agents e.g. "gorilla|desesplorer|tigrus"

setSecureback to summary
public void setSecure(boolean b)
setServerback to summary
public void setServer(String server)

Set the server header name.

Parameters
server:String

The new value to use for the server header

setServerRemoveAppProvidedValuesback to summary
public void setServerRemoveAppProvidedValues(boolean serverRemoveAppProvidedValues)
setSSLEnabledback to summary
public void setSSLEnabled(boolean SSLEnabled)
setUseKeepAliveResponseHeaderback to summary
public void setUseKeepAliveResponseHeader(boolean useKeepAliveResponseHeader)
setUseSendfileback to summary
public void setUseSendfile(boolean useSendfile)
useCompressionback to summary
public boolean useCompression(Request request, Response response)