Home / Function/ oldValidationAlgorithmValidateValueChar() — netty Function Reference

oldValidationAlgorithmValidateValueChar() — netty Function Reference

Architecture documentation for the oldValidationAlgorithmValidateValueChar() function in HttpHeaderValidationUtilTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4fbefeac_387c_2d68_d6d0_03576bee1af0["oldValidationAlgorithmValidateValueChar()"]
  41393c8c_1006_6327_605c_681db4fcf453["HttpHeaderValidationUtilTest"]
  4fbefeac_387c_2d68_d6d0_03576bee1af0 -->|defined in| 41393c8c_1006_6327_605c_681db4fcf453
  808cdeb3_1120_5335_6548_a1abe3a66502["oldHeaderValueValidationAlgorithm()"]
  808cdeb3_1120_5335_6548_a1abe3a66502 -->|calls| 4fbefeac_387c_2d68_d6d0_03576bee1af0
  style 4fbefeac_387c_2d68_d6d0_03576bee1af0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpHeaderValidationUtilTest.java lines 430–480

    private static int oldValidationAlgorithmValidateValueChar(int state, char character) {
        /*
         * State:
         * 0: Previous character was neither CR nor LF
         * 1: The previous character was CR
         * 2: The previous character was LF
         */
        if ((character & ~15) == 0) {
            // Check the absolutely prohibited characters.
            switch (character) {
                case 0x0: // NULL
                    throw VALIDATION_EXCEPTION;
                case 0x0b: // Vertical tab
                    throw VALIDATION_EXCEPTION;
                case '\f':
                    throw VALIDATION_EXCEPTION;
                default:
                    break;
            }
        }

        // Check the CRLF (HT | SP) pattern
        switch (state) {
            case 0:
                switch (character) {
                    case '\r':
                        return 1;
                    case '\n':
                        return 2;
                    default:
                        break;
                }
                break;
            case 1:
                if (character == '\n') {
                    return 2;
                }
                throw VALIDATION_EXCEPTION;
            case 2:
                switch (character) {
                    case '\t':
                    case ' ':
                        return 0;
                    default:
                        throw VALIDATION_EXCEPTION;
                }
            default:
                break;
        }
        return state;
    }

Domain

Subdomains

Frequently Asked Questions

What does oldValidationAlgorithmValidateValueChar() do?
oldValidationAlgorithmValidateValueChar() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpHeaderValidationUtilTest.java.
Where is oldValidationAlgorithmValidateValueChar() defined?
oldValidationAlgorithmValidateValueChar() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpHeaderValidationUtilTest.java at line 430.
What calls oldValidationAlgorithmValidateValueChar()?
oldValidationAlgorithmValidateValueChar() is called by 1 function(s): oldHeaderValueValidationAlgorithm.

Analyze Your Own Codebase

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

Try Supermodel Free