MCPcopy Create free account
hub / github.com/aria2/aria2 / websocketHandshake

Function websocketHandshake

src/HttpServerCommand.cc:137–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135
136namespace {
137int websocketHandshake(const HttpHeader* header)
138{
139 if (header->getMethod() != "GET" ||
140 header->find(HttpHeader::SEC_WEBSOCKET_KEY).empty()) {
141 return 400;
142 }
143 else if (header->find(HttpHeader::SEC_WEBSOCKET_VERSION) != "13") {
144 return 426;
145 }
146 else if (header->getRequestPath() != "/jsonrpc") {
147 return 404;
148 }
149 else {
150 return 101;
151 }
152}
153} // namespace
154
155#endif // ENABLE_WEBSOCKET

Callers 1

executeMethod · 0.85

Calls 2

emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected