Class HttpConversionUtil.Http2ToHttpHeaderTranslator

  • Enclosing class:
    HttpConversionUtil

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

      • REQUEST_HEADER_TRANSLATIONS

        private static final CharSequenceMap<AsciiString> REQUEST_HEADER_TRANSLATIONS
        Translations from HTTP/2 header name to the HTTP/1.x equivalent.
      • 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
    • Constructor Detail

      • 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 Detail

      • translateHeaders

        void translateHeaders​(java.lang.Iterable<java.util.Map.Entry<java.lang.CharSequence,​java.lang.CharSequence>> inputHeaders)
                       throws Http2Exception
        Throws:
        Http2Exception