TSHttpHdrHostGet

Synopsis

#include <ts/ts.h>

const char* TSHttpHdrHostGet(TSMBuffer bufp, TSMLoc offset, int * length)

Description

Get the host for the request. :arg:`bufp` and :arg:`offset` must reference an HTTP request header. A pointer to the host is returned and the length is stored in the int pointed at by :arg:`length`. Note the returned text may not be null terminated. The URL in the request is checked first then the Host header field.

注解

This is much faster than calling TSHttpEffectiveUrlStringGet() and extracting the host from the result.