Home / Type/ Http3Headers Type — netty Architecture

Http3Headers Type — netty Architecture

Architecture documentation for the Http3Headers type/interface in Http3Headers.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0051cf80_04ef_eca9_1b6b_3647f476bc72["Http3Headers"]
  10f8df17_4b30_e52f_6b1b_904b67da0fb5["Http3Headers.java"]
  0051cf80_04ef_eca9_1b6b_3647f476bc72 -->|defined in| 10f8df17_4b30_e52f_6b1b_904b67da0fb5
  style 0051cf80_04ef_eca9_1b6b_3647f476bc72 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http3/src/main/java/io/netty/handler/codec/http3/Http3Headers.java lines 25–278

public interface Http3Headers extends Headers<CharSequence, CharSequence, Http3Headers> {

    /**
     * HTTP/2 (and HTTP/3) pseudo-headers names.
     */
    enum PseudoHeaderName {
        /**
         * {@code :method}.
         */
        METHOD(":method", true, 0x1),

        /**
         * {@code :scheme}.
         */
        SCHEME(":scheme", true, 0x2),

        /**
         * {@code :authority}.
         */
        AUTHORITY(":authority", true, 0x4),

        /**
         * {@code :path}.
         */
        PATH(":path", true, 0x8),

        /**
         * {@code :status}.
         */
        STATUS(":status", false, 0x10),

        /**
         * {@code :protocol}.
         * <p>
         * Used for Extended CONNECT requests as defined in RFC 9220.
         * This pseudo-header is only valid for CONNECT requests and indicates
         * the desired protocol for the connection (e.g., "webtransport", "websocket").
         *
         * @see <a href="https://www.rfc-editor.org/rfc/rfc9220.html">RFC 9220: Bootstrapping WebSockets with HTTP/3</a>
         */
        PROTOCOL(":protocol", true, 0x20);

        private static final char PSEUDO_HEADER_PREFIX = ':';
        private static final byte PSEUDO_HEADER_PREFIX_BYTE = (byte) PSEUDO_HEADER_PREFIX;

        private final AsciiString value;
        private final boolean requestOnly;
        // The position of the bit in the flag indicates the type of the header field
        private final int flag;
        private static final CharSequenceMap<PseudoHeaderName> PSEUDO_HEADERS = new CharSequenceMap<PseudoHeaderName>();

        static {
            for (PseudoHeaderName pseudoHeader : PseudoHeaderName.values()) {
                PSEUDO_HEADERS.add(pseudoHeader.value(), pseudoHeader);
            }
        }

        PseudoHeaderName(String value, boolean requestOnly, int flag) {
            this.value = AsciiString.cached(value);
            this.requestOnly = requestOnly;
            this.flag = flag;
        }

        public AsciiString value() {
            // Return a slice so that the buffer gets its own reader index.
            return value;
        }

        /**
         * Indicates whether the specified header follows the pseudo-header format (begins with ':' character)
         *
         * @param headerName    the header name to check.
         * @return              {@code true} if the header follow the pseudo-header format
         */
        public static boolean hasPseudoHeaderFormat(CharSequence headerName) {
            if (headerName instanceof AsciiString) {
                final AsciiString asciiHeaderName = (AsciiString) headerName;
                return asciiHeaderName.length() > 0 && asciiHeaderName.byteAt(0) == PSEUDO_HEADER_PREFIX_BYTE;
            } else {
                return headerName.length() > 0 && headerName.charAt(0) == PSEUDO_HEADER_PREFIX;
            }

Frequently Asked Questions

What is the Http3Headers type?
Http3Headers is a type/interface in the netty codebase, defined in codec-http3/src/main/java/io/netty/handler/codec/http3/Http3Headers.java.
Where is Http3Headers defined?
Http3Headers is defined in codec-http3/src/main/java/io/netty/handler/codec/http3/Http3Headers.java at line 25.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free