HttpHeadersFind
Description
Find a header by key (case-sensitive zero-terminated comparison).
Success
Pointer to the matching header inside the vector.
Failure
NULL if no header matches.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Http.c:26:
(ZstrCompare(next, "body-bytes") == 0);
HttpHeader *host = HttpHeadersFind(&req.headers, "Host");
ok = ok && host && ZstrCompare(host->value.data, "example.com") == 0;- In
Http.c:60:
}
HttpHeader *HttpHeadersFind(HttpHeaders *headers, const char *key) {
if (!headers || !key) {
LOG_ERROR("invalid arguments");
Last updated on