Handling large GET requests with Jetty

Managed by | Updated .

Background

Jetty uses a buffer to store headers for HTTP requests. In some circumstances the header buffer used by Jetty is too small and requests will cause this buffer to overflow resulting in a HTTP 413 error being returned and a blank result page.  This article shows how to increase the value of this buffer.

Info

The header buffer size defaults are:

  • 16k for Funnelback 14.0 and above
  • 8k for Funnelback versions 13.2 and below

Steps

In order to handle large GET requests you need to increase the size of the buffer used for headers. To do this you need to edit the jetty configuration, add a parameter then restart Jetty.

The Jetty configuration is found at $SEARCH_HOME/web/conf/contexts-public/funnelback-publicui.xml

The relevant parameter will depend on the version of Jetty that is used by the version of Funnelback -  headerBufferSize or requestHeaderSize parameter that is set in the connectors section.  

The running version of Jetty can be found by logging in to the administration interface and selecting view diagnostics from the system menu.

Example:

funnelback-publicui.xml
<Call name="addConnector">
    <Arg>
        <New class="org.mortbay.jetty.security.SslSocketConnector">
<!-- Note : By default Funnelback uses a self-signed certificate which was generated with -->
<!-- $ keytool -keystore keystore -alias jetty -genkey -validity 99999 -keyalg RSA -->
            <Set name="Port">8443</Set>
            <Set name="maxIdleTime">30000</Set>
            <Set name="keystore">E:\Funnelback/web/conf/keystore</Set>
            <Set name="password">funnelback</Set>
            <Set name="keyPassword">funnelback</Set>
            <Set name="truststore">E:\Funnelback/web/conf/keystore</Set>
            <Set name="trustPassword">funnelback</Set>
            <Set name="headerBufferSize">16384</Set>
    </New>
    </Arg>
</Call>
Was this artcle helpful?

Comments