Home / Function/ DefaultCookie() — netty Function Reference

DefaultCookie() — netty Function Reference

Architecture documentation for the DefaultCookie() function in CookieDecoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4b7acde2_d057_5b08_cc05_1199e83d8bbd["DefaultCookie()"]
  841c58a8_6f5c_8c20_e8ec_e79013189bd7["CookieDecoder"]
  4b7acde2_d057_5b08_cc05_1199e83d8bbd -->|defined in| 841c58a8_6f5c_8c20_e8ec_e79013189bd7
  style 4b7acde2_d057_5b08_cc05_1199e83d8bbd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/CookieDecoder.java lines 328–368

    private DefaultCookie initCookie(String name, String value) {
        if (name == null || name.length() == 0) {
            logger.debug("Skipping cookie with null name");
            return null;
        }

        if (value == null) {
            logger.debug("Skipping cookie with null value");
            return null;
        }

        CharSequence unwrappedValue = unwrapValue(value);
        if (unwrappedValue == null) {
            logger.debug("Skipping cookie because starting quotes are not properly balanced in '{}'",
                    unwrappedValue);
            return null;
        }

        int invalidOctetPos;
        if (strict && (invalidOctetPos = firstInvalidCookieNameOctet(name)) >= 0) {
            if (logger.isDebugEnabled()) {
                logger.debug("Skipping cookie because name '{}' contains invalid char '{}'",
                        name, name.charAt(invalidOctetPos));
            }
            return null;
        }

        final boolean wrap = unwrappedValue.length() != value.length();

        if (strict && (invalidOctetPos = firstInvalidCookieValueOctet(unwrappedValue)) >= 0) {
            if (logger.isDebugEnabled()) {
                logger.debug("Skipping cookie because value '{}' contains invalid char '{}'",
                        unwrappedValue, unwrappedValue.charAt(invalidOctetPos));
            }
            return null;
        }

        DefaultCookie cookie = new DefaultCookie(name, unwrappedValue.toString());
        cookie.setWrap(wrap);
        return cookie;
    }

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free