Home / Function/ HeaderType() — netty Function Reference

HeaderType() — netty Function Reference

Architecture documentation for the HeaderType() function in HpackDecoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c1b5aae4_50f3_8c8a_1313_f22971fe17cd["HeaderType()"]
  929eb7d3_94e9_fa41_fd78_c76a9b499b89["HpackDecoder"]
  c1b5aae4_50f3_8c8a_1313_f22971fe17cd -->|defined in| 929eb7d3_94e9_fa41_fd78_c76a9b499b89
  style c1b5aae4_50f3_8c8a_1313_f22971fe17cd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java lines 385–409

    private static HeaderType validateHeader(int streamId, AsciiString name, CharSequence value,
            HeaderType previousHeaderType) throws Http2Exception {
        if (hasPseudoHeaderFormat(name)) {
            if (previousHeaderType == HeaderType.REGULAR_HEADER) {
                throw streamError(streamId, PROTOCOL_ERROR,
                        "Pseudo-header field '%s' found after regular header.", name);
            }
            final Http2Headers.PseudoHeaderName pseudoHeader = getPseudoHeader(name);
            final HeaderType currentHeaderType = pseudoHeader.isRequestOnly() ?
                    HeaderType.REQUEST_PSEUDO_HEADER : HeaderType.RESPONSE_PSEUDO_HEADER;
            if (previousHeaderType != null && currentHeaderType != previousHeaderType) {
                throw streamError(streamId, PROTOCOL_ERROR, "Mix of request and response pseudo-headers.");
            }
            return currentHeaderType;
        }
        if (HttpHeaderValidationUtil.isConnectionHeader(name, true)) {
            throw streamError(streamId, PROTOCOL_ERROR, "Illegal connection-specific header '%s' encountered.", name);
        }
        if (HttpHeaderValidationUtil.isTeNotTrailers(name, value)) {
            throw streamError(streamId, PROTOCOL_ERROR,
                    "Illegal value specified for the 'TE' header (only 'trailers' is allowed).");
        }

        return HeaderType.REGULAR_HEADER;
    }

Domain

Subdomains

Frequently Asked Questions

What does HeaderType() do?
HeaderType() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java.
Where is HeaderType() defined?
HeaderType() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java at line 385.

Analyze Your Own Codebase

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

Try Supermodel Free