testDuplicateWebsocketHandshakeHeaders() — netty Function Reference
Architecture documentation for the testDuplicateWebsocketHandshakeHeaders() function in WebSocketClientHandshakerTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD abd0b174_ee57_be96_5a4f_ee3714aef8a8["testDuplicateWebsocketHandshakeHeaders()"] 2cb6ab9a_d30f_c725_5b7e_5ad8d513e6b9["WebSocketClientHandshakerTest"] abd0b174_ee57_be96_5a4f_ee3714aef8a8 -->|defined in| 2cb6ab9a_d30f_c725_5b7e_5ad8d513e6b9 6d31a252_e73f_521a_9586_cfba0cbcea37["getHandshakeRequiredHeaderNames()"] abd0b174_ee57_be96_5a4f_ee3714aef8a8 -->|calls| 6d31a252_e73f_521a_9586_cfba0cbcea37 style abd0b174_ee57_be96_5a4f_ee3714aef8a8 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshakerTest.java lines 424–456
@Test
public void testDuplicateWebsocketHandshakeHeaders() {
URI uri = URI.create("ws://localhost:9999/foo");
HttpHeaders inputHeaders = new DefaultHttpHeaders();
String bogusSubProtocol = "bogusSubProtocol";
String bogusHeaderValue = "bogusHeaderValue";
// add values for the headers that are reserved for use in the websockets handshake
for (CharSequence header : getHandshakeRequiredHeaderNames()) {
if (!HttpHeaderNames.HOST.equals(header)) {
inputHeaders.add(header, bogusHeaderValue);
}
}
inputHeaders.add(getProtocolHeaderName(), bogusSubProtocol);
String realSubProtocol = "realSubProtocol";
WebSocketClientHandshaker handshaker = newHandshaker(uri, realSubProtocol, inputHeaders, false, true);
FullHttpRequest request = handshaker.newHandshakeRequest();
HttpHeaders outputHeaders = request.headers();
// the header values passed in originally have been replaced with values generated by the Handshaker
for (CharSequence header : getHandshakeRequiredHeaderNames()) {
assertEquals(1, outputHeaders.getAll(header).size());
assertNotEquals(bogusHeaderValue, outputHeaders.get(header));
}
// the subprotocol header value is that of the subprotocol string passed into the Handshaker
assertEquals(1, outputHeaders.getAll(getProtocolHeaderName()).size());
assertEquals(realSubProtocol, outputHeaders.get(getProtocolHeaderName()));
request.release();
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does testDuplicateWebsocketHandshakeHeaders() do?
testDuplicateWebsocketHandshakeHeaders() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshakerTest.java.
Where is testDuplicateWebsocketHandshakeHeaders() defined?
testDuplicateWebsocketHandshakeHeaders() is defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshakerTest.java at line 424.
What does testDuplicateWebsocketHandshakeHeaders() call?
testDuplicateWebsocketHandshakeHeaders() calls 1 function(s): getHandshakeRequiredHeaderNames.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free