| 408 | } |
| 409 | |
| 410 | bool HttpWebSocketHandshake::headerContainsToken(StringSpan headerValue, StringSpan token) |
| 411 | { |
| 412 | const char* start = headerValue.bytesWithoutTerminator(); |
| 413 | const char* end = start + headerValue.sizeInBytes(); |
| 414 | const char* tokenStart = start; |
| 415 | for (const char* it = start; it <= end; ++it) |
| 416 | { |
| 417 | if (it == end or *it == ',') |
| 418 | { |
| 419 | StringSpan part = scHttpWebSocketTrim( |
| 420 | {{tokenStart, static_cast<size_t>(it - tokenStart)}, false, headerValue.getEncoding()}); |
| 421 | if (scHttpWebSocketEqualsIgnoreCase(part, token)) |
| 422 | { |
| 423 | return true; |
| 424 | } |
| 425 | tokenStart = it + 1; |
| 426 | } |
| 427 | } |
| 428 | return false; |
| 429 | } |
| 430 | |
| 431 | HttpWebSocketHandshakeResult HttpWebSocketHandshake::validateServerRequest( |
| 432 | const HttpWebSocketServerHandshakeRequestView& request) |
nothing calls this directly
no test coverage detected