Home / Function/ toHttp3Headers() — netty Function Reference

toHttp3Headers() — netty Function Reference

Architecture documentation for the toHttp3Headers() function in HttpConversionUtil.java from the netty codebase.

Function java Buffer Allocators calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  616d6333_d176_7624_5a45_c42cfec4f670["toHttp3Headers()"]
  cca5f017_2e30_72b9_fc2a_eca3446d8058["HttpConversionUtil"]
  616d6333_d176_7624_5a45_c42cfec4f670 -->|defined in| cca5f017_2e30_72b9_fc2a_eca3446d8058
  fced85db_4e33_478e_0d61_c9c5162401e1["Http3Headers()"]
  fced85db_4e33_478e_0d61_c9c5162401e1 -->|calls| 616d6333_d176_7624_5a45_c42cfec4f670
  379a3e40_c6c8_5836_7be0_c1ffdac284d9["toLowercaseMap()"]
  616d6333_d176_7624_5a45_c42cfec4f670 -->|calls| 379a3e40_c6c8_5836_7be0_c1ffdac284d9
  9efa8ce2_5c78_b5d4_4bf7_bf64c5e0f54f["toHttp3HeadersFilterTE()"]
  616d6333_d176_7624_5a45_c42cfec4f670 -->|calls| 9efa8ce2_5c78_b5d4_4bf7_bf64c5e0f54f
  style 616d6333_d176_7624_5a45_c42cfec4f670 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http3/src/main/java/io/netty/handler/codec/http3/HttpConversionUtil.java lines 458–502

    static void toHttp3Headers(HttpHeaders inHeaders, Http3Headers out) {
        Iterator<Entry<CharSequence, CharSequence>> iter = inHeaders.iteratorCharSequence();
        // Choose 8 as a default size because it is unlikely we will see more than 4 Connection headers values, but
        // still allowing for "enough" space in the map to reduce the chance of hash code collision.
        CharSequenceMap<AsciiString> connectionBlacklist =
            toLowercaseMap(inHeaders.valueCharSequenceIterator(CONNECTION), 8);
        while (iter.hasNext()) {
            Entry<CharSequence, CharSequence> entry = iter.next();
            final AsciiString aName = AsciiString.of(entry.getKey()).toLowerCase();
            if (!HTTP_TO_HTTP3_HEADER_BLACKLIST.contains(aName) && !connectionBlacklist.contains(aName)) {
                // https://quicwg.org/base-drafts/draft-ietf-quic-http.html#section-4.1.1 makes a special exception
                // for TE
                if (aName.contentEqualsIgnoreCase(TE)) {
                    toHttp3HeadersFilterTE(entry, out);
                } else if (aName.contentEqualsIgnoreCase(COOKIE)) {
                    AsciiString value = AsciiString.of(entry.getValue());
                    // split up cookies to allow for better compression
                    try {
                        int index = value.forEachByte(FIND_SEMI_COLON);
                        if (index != -1) {
                            int start = 0;
                            do {
                                out.add(COOKIE, value.subSequence(start, index, false));
                                // skip 2 characters "; " (see https://tools.ietf.org/html/rfc6265#section-4.2.1)
                                start = index + 2;
                            } while (start < value.length() &&
                                    (index = value.forEachByte(start, value.length() - start, FIND_SEMI_COLON)) != -1);
                            if (start >= value.length()) {
                                throw new IllegalArgumentException("cookie value is of unexpected format: " + value);
                            }
                            out.add(COOKIE, value.subSequence(start, value.length(), false));
                        } else {
                            out.add(COOKIE, value);
                        }
                    } catch (Exception e) {
                        // This is not expect to happen because FIND_SEMI_COLON never throws but must be caught
                        // because of the ByteProcessor interface.
                        throw new IllegalStateException(e);
                    }
                } else {
                    out.add(aName, entry.getValue());
                }
            }
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does toHttp3Headers() do?
toHttp3Headers() is a function in the netty codebase, defined in codec-http3/src/main/java/io/netty/handler/codec/http3/HttpConversionUtil.java.
Where is toHttp3Headers() defined?
toHttp3Headers() is defined in codec-http3/src/main/java/io/netty/handler/codec/http3/HttpConversionUtil.java at line 458.
What does toHttp3Headers() call?
toHttp3Headers() calls 2 function(s): toHttp3HeadersFilterTE, toLowercaseMap.
What calls toHttp3Headers()?
toHttp3Headers() is called by 1 function(s): Http3Headers.

Analyze Your Own Codebase

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

Try Supermodel Free