You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by "Alan M. Carroll" <am...@network-geographics.com> on 2014/09/20 00:09:25 UTC

[API REVIEW] TSHttpHdrHostGet

TSHttpHdrHostGet
==================

Synopsis
--------

`#include <ts/ts.h>`

.. c:function:: 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, if :arg:`length` is not ``NULL`` the length is stored at that location. Note the returned text may not be null terminated. The URL in the request is checked first, and then the ``HOST`` header field.


Re: [API REVIEW] TSHttpHdrHostGet

Posted by James Peach <jp...@apache.org>.
On Sep 19, 2014, at 3:09 PM, Alan M. Carroll <am...@network-geographics.com> wrote:

> TSHttpHdrHostGet
> ==================
> 
> Synopsis
> --------
> 
> `#include <ts/ts.h>`
> 
> .. c:function:: 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, if :arg:`length` is not ``NULL`` the length is stored at that location.

arg must not be NULL, otherwise you can't know the length of the output

> Note the returned text may not be null terminated. The URL in the request is checked first, and then the ``HOST`` header field.
>