Home / Function/ verify() — netty Function Reference

verify() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  bf053156_bb80_b73d_0d64_0c097427f3db["verify()"]
  65386c76_5fdd_9bc6_905a_654742368a12["WebSocketClientHandshaker00"]
  bf053156_bb80_b73d_0d64_0c097427f3db -->|defined in| 65386c76_5fdd_9bc6_905a_654742368a12
  style bf053156_bb80_b73d_0d64_0c097427f3db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker00.java lines 266–288

    @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);
        }

        ByteBuf challenge = response.content();
        if (!challenge.equals(expectedChallengeResponseBytes)) {
            throw new WebSocketClientHandshakeException("Invalid challenge", 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/WebSocketClientHandshaker00.java.
Where is verify() defined?
verify() is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker00.java at line 266.

Analyze Your Own Codebase

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

Try Supermodel Free