3
This plugin adds a header to a request.
5
Enter the text of the header to be added into the plugin.config file; for
7
enter the following line in plugin.config
9
On NT: AddHeader.dll "name1: value1" "name2: value2"
10
On Solaris: add-header.so "name1: value1" "name2: value2"
12
The TSPluginInit function does the following:
14
- creates a MIME field buffer that contains the header to be added,
15
using the following functions:
21
TSMimeHdrFieldValueAppend
24
- sets up the callback for the add-header-plugin function, which
25
is the main callback function, using
26
TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK,
27
TSContCreate(add_header_plugin, NULL);
29
add_header_plugin is the main function in the plugin. In the
30
event of TS_EVENT_HTTP_READ_REQUEST_HDR (when the HTTP
31
state machine reads a request header), it calls the function
34
add_header first makes sure that it can retrieve the client request
35
header from the current transaction, using
38
copies the header into the MIME headers of the
39
HTTP request, using the following functions:
47
When add_header is done, it uses