Class DefaultHttp2HeadersDecoder

java.lang.Object
io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder
All Implemented Interfaces:
Http2HeadersDecoder, Http2HeadersDecoder.Configuration

public class DefaultHttp2HeadersDecoder extends Object implements Http2HeadersDecoder, Http2HeadersDecoder.Configuration
  • Field Details

    • HEADERS_COUNT_WEIGHT_NEW

      private static final float HEADERS_COUNT_WEIGHT_NEW
      See Also:
    • HEADERS_COUNT_WEIGHT_HISTORICAL

      private static final float HEADERS_COUNT_WEIGHT_HISTORICAL
      See Also:
    • hpackDecoder

      private final HpackDecoder hpackDecoder
    • validateHeaders

      private final boolean validateHeaders
    • validateHeaderValues

      private final boolean validateHeaderValues
    • maxHeaderListSizeGoAway

      private long maxHeaderListSizeGoAway
    • headerArraySizeAccumulator

      private float headerArraySizeAccumulator
      Used to calculate an exponential moving average of header sizes to get an estimate of how large the data structure for storing headers should be.
  • Constructor Details

    • DefaultHttp2HeadersDecoder

      public DefaultHttp2HeadersDecoder()
    • DefaultHttp2HeadersDecoder

      public DefaultHttp2HeadersDecoder(boolean validateHeaders)
      Create a new instance.
      Parameters:
      validateHeaders - true to validate headers are valid according to the RFC.
    • DefaultHttp2HeadersDecoder

      public DefaultHttp2HeadersDecoder(boolean validateHeaders, boolean validateHeaderValues)
      Create a new instance.
      Parameters:
      validateHeaders - true to validate headers are valid according to the RFC. This validates everything except header values.
      validateHeaderValues - true to validate that header values are valid according to the RFC. Since this is potentially expensive, it can be enabled separately from validateHeaders.
    • DefaultHttp2HeadersDecoder

      public DefaultHttp2HeadersDecoder(boolean validateHeaders, long maxHeaderListSize)
      Create a new instance.
      Parameters:
      validateHeaders - true to validate headers are valid according to the RFC.
      maxHeaderListSize - This is the only setting that can be configured before notifying the peer. This is because SETTINGS_MAX_HEADER_LIST_SIZE allows a lower than advertised limit from being enforced, and the default limit is unlimited (which is dangerous).
    • DefaultHttp2HeadersDecoder

      public DefaultHttp2HeadersDecoder(boolean validateHeaders, boolean validateHeaderValues, long maxHeaderListSize)
      Create a new instance.
      Parameters:
      validateHeaders - true to validate headers are valid according to the RFC. This validates everything except header values.
      validateHeaderValues - true to validate that header values are valid according to the RFC. Since this is potentially expensive, it can be enabled separately from validateHeaders.
      maxHeaderListSize - This is the only setting that can be configured before notifying the peer. This is because SETTINGS_MAX_HEADER_LIST_SIZE allows a lower than advertised limit from being enforced, and the default limit is unlimited (which is dangerous).
    • DefaultHttp2HeadersDecoder

      public DefaultHttp2HeadersDecoder(boolean validateHeaders, long maxHeaderListSize, @Deprecated int initialHuffmanDecodeCapacity)
      Create a new instance.
      Parameters:
      validateHeaders - true to validate headers are valid according to the RFC. This validates everything except header values.
      maxHeaderListSize - This is the only setting that can be configured before notifying the peer. This is because SETTINGS_MAX_HEADER_LIST_SIZE allows a lower than advertised limit from being enforced, and the default limit is unlimited (which is dangerous).
      initialHuffmanDecodeCapacity - Does nothing, do not use.
    • DefaultHttp2HeadersDecoder

      DefaultHttp2HeadersDecoder(boolean validateHeaders, boolean validateHeaderValues, HpackDecoder hpackDecoder)
      Exposed for testing only! Default values used in the initial settings frame are overridden intentionally for testing but violate the RFC if used outside the scope of testing.
  • Method Details