Class HttpConversionUtil.Http2ToHttpHeaderTranslator

java.lang.Object
io.netty.handler.codec.http2.HttpConversionUtil.Http2ToHttpHeaderTranslator
Enclosing class:
HttpConversionUtil

private static final class HttpConversionUtil.Http2ToHttpHeaderTranslator extends Object
Utility which translates HTTP/2 headers to HTTP/1 headers.
  • Field Details

    • REQUEST_HEADER_TRANSLATIONS

      private static final CharSequenceMap<AsciiString> REQUEST_HEADER_TRANSLATIONS
      Translations from HTTP/2 header name to the HTTP/1.x equivalent.
    • RESPONSE_HEADER_TRANSLATIONS

      private static final CharSequenceMap<AsciiString> RESPONSE_HEADER_TRANSLATIONS
    • CONNECT_REQUEST_HEADER_TRANSLATIONS

      private static final CharSequenceMap<AsciiString> CONNECT_REQUEST_HEADER_TRANSLATIONS
      Translations used for Extended CONNECT (RFC 8441) requests. In addition to the regular request translations, the ':path' and ':protocol' pseudo-headers are preserved as extension headers so that an Extended CONNECT request cannot be mistaken for a regular CONNECT request once converted to an HTTP/1.x object.
    • streamId

      private final int streamId
    • output

      private final HttpHeaders output
    • translations

      private final CharSequenceMap<AsciiString> translations
  • Constructor Details

    • Http2ToHttpHeaderTranslator

      Http2ToHttpHeaderTranslator(int streamId, HttpHeaders output, boolean request, boolean connect)
      Create a new instance
      Parameters:
      output - The HTTP/1.x headers object to store the results of the translation
      request - if true, translates headers using the request translation map. Otherwise uses the response translation map.
      connect - if true, translates headers using the CONNECT request translation map, which additionally preserves the ':path' and ':protocol' pseudo-headers of an Extended CONNECT (RFC 8441) request as extension headers. Ignored unless request is true.
  • Method Details