MCPcopy Create free account
hub / github.com/JoaoLopesF/RemoteDebug / onValidateHttpHeader

Method onValidateHttpHeader

src/utility/WebSocketsServer.cpp:152–168  ·  view source on GitHub ↗

* Sets the custom http header validator function * @param httpHeaderValidationFunc WebSocketServerHttpHeaderValFunc ///< pointer to the custom http header validation function * @param mandatoryHttpHeaders[] const char* ///< the array of named http headers considered to be mandatory / must be present in order for websocket upgrade to succeed * @param mandatoryHttpHeaderCount size_t ///< the n

Source from the content-addressed store, hash-verified

150 * @param mandatoryHttpHeaderCount size_t ///< the number of items in the mandatoryHttpHeaders array
151 */
152void WebSocketsServer::onValidateHttpHeader(
153 WebSocketServerHttpHeaderValFunc validationFunc,
154 const char* mandatoryHttpHeaders[],
155 size_t mandatoryHttpHeaderCount)
156{
157 _httpHeaderValidationFunc = validationFunc;
158
159 if (_mandatoryHttpHeaders)
160 delete[] _mandatoryHttpHeaders;
161
162 _mandatoryHttpHeaderCount = mandatoryHttpHeaderCount;
163 _mandatoryHttpHeaders = new String[_mandatoryHttpHeaderCount];
164
165 for (size_t i = 0; i < _mandatoryHttpHeaderCount; i++) {
166 _mandatoryHttpHeaders[i] = mandatoryHttpHeaders[i];
167 }
168}
169
170/*
171 * send text data to client

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected