Home / Function/ verify() — netty Function Reference

verify() — netty Function Reference

Architecture documentation for the verify() function in WebSocketClientHandshaker07.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  3f68aa5c_2de9_cf26_51f7_309b784bcbe0["verify()"]
  9df1edec_18d7_0ea2_1c77_46c3f30db1bc["WebSocketClientHandshaker07"]
  3f68aa5c_2de9_cf26_51f7_309b784bcbe0 -->|defined in| 9df1edec_18d7_0ea2_1c77_46c3f30db1bc
  style 3f68aa5c_2de9_cf26_51f7_309b784bcbe0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker07.java lines 305–328

    @Override
    protected void verify(FullHttpResponse response) {
        HttpResponseStatus status = response.status();
        if (!HttpResponseStatus.SWITCHING_PROTOCOLS.equals(status)) {
            throw new WebSocketClientHandshakeException("Invalid handshake response getStatus: " + status, response);
        }

        HttpHeaders headers = response.headers();
        CharSequence upgrade = headers.get(HttpHeaderNames.UPGRADE);
        if (!HttpHeaderValues.WEBSOCKET.contentEqualsIgnoreCase(upgrade)) {
            throw new WebSocketClientHandshakeException("Invalid handshake response upgrade: " + upgrade, response);
        }

        if (!headers.containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE, true)) {
            throw new WebSocketClientHandshakeException("Invalid handshake response connection: "
                    + headers.get(HttpHeaderNames.CONNECTION), response);
        }

        CharSequence accept = headers.get(HttpHeaderNames.SEC_WEBSOCKET_ACCEPT);
        if (accept == null || !accept.equals(expectedChallengeResponseString)) {
            throw new WebSocketClientHandshakeException(String.format(
                    "Invalid challenge. Actual: %s. Expected: %s", accept, expectedChallengeResponseString), response);
        }
    }

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free