Home / Function/ isConnectionHeader() — netty Function Reference

isConnectionHeader() — netty Function Reference

Architecture documentation for the isConnectionHeader() function in HttpHeaderValidationUtil.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  8c581cc7_438d_997a_0367_2152cac71756["isConnectionHeader()"]
  f369fc32_9e23_f7f4_8a18_b9a88f492d8b["HttpHeaderValidationUtil"]
  8c581cc7_438d_997a_0367_2152cac71756 -->|defined in| f369fc32_9e23_f7f4_8a18_b9a88f492d8b
  style 8c581cc7_438d_997a_0367_2152cac71756 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaderValidationUtil.java lines 49–74

    @SuppressWarnings("deprecation") // We need to check for deprecated headers as well.
    public static boolean isConnectionHeader(CharSequence name, boolean ignoreTeHeader) {
        // These are the known standard and non-standard connection related headers:
        // - upgrade (7 chars)
        // - connection (10 chars)
        // - keep-alive (10 chars)
        // - proxy-connection (16 chars)
        // - transfer-encoding (17 chars)
        //
        // See https://datatracker.ietf.org/doc/html/rfc9113#section-8.2.2
        // and https://datatracker.ietf.org/doc/html/rfc9110#section-7.6.1
        // for the list of connection related headers.
        //
        // We scan for these based on the length, then double-check any matching name.
        int len = name.length();
        switch (len) {
            case 2: return ignoreTeHeader? false : contentEqualsIgnoreCase(name, HttpHeaderNames.TE);
            case 7: return contentEqualsIgnoreCase(name, HttpHeaderNames.UPGRADE);
            case 10: return contentEqualsIgnoreCase(name, HttpHeaderNames.CONNECTION) ||
                    contentEqualsIgnoreCase(name, HttpHeaderNames.KEEP_ALIVE);
            case 16: return contentEqualsIgnoreCase(name, HttpHeaderNames.PROXY_CONNECTION);
            case 17: return contentEqualsIgnoreCase(name, HttpHeaderNames.TRANSFER_ENCODING);
            default:
                return false;
        }
    }

Subdomains

Frequently Asked Questions

What does isConnectionHeader() do?
isConnectionHeader() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaderValidationUtil.java.
Where is isConnectionHeader() defined?
isConnectionHeader() is defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaderValidationUtil.java at line 49.

Analyze Your Own Codebase

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

Try Supermodel Free