Forums » Development »
[Solved] Trying to add HTTP_ACCEPT
Added by Roz over 13 years ago
Hello,
I need to use HTTP_ACCEPT in config file.
What I am trying to do, add lines in source:
configparser.c (line 1224) { COMP_HTTP_ACCEPT, CONST_STR_LEN("HTTP[\"accept\"]" ) },
configparser.y (line 437) { COMP_HTTP_ACCEPT, CONST_STR_LEN("HTTP[\"accept\"]" ) },
array.h (line 99)
COMP_HTTP_ACCEPT,
configfile-glue.c (line 458)
case COMP_HTTP_ACCEPT: {
data_string *ds;
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Accept"))) {
l = ds->value;
} else {
l = srv->empty_string;
}
break;
}
After that I compile source and start lighttpd.
In config file "accept" working, but I think always empty (cant debug variable, cant print in log file).
Who can help me with this?
Thank you.
Replies (2)
RE: Trying to add HTTP_ACCEPT - Added by clintr over 13 years ago
A bit late into this thread, but you also have to modify response.c and add:
config_patch_connection(srv, con, COMP_HTTP_ACCEPT); /* Accept: */
There is an existing patch to add Accept: and additional headers at:
http://www.laconicsecurity.com/content/lighttpd-extended-headers-1.4.26.patch
RE: [Solved] Trying to add HTTP_ACCEPT - Added by gstrauss about 7 years ago
lighttpd 1.4.46 will add the ability to write config conditions against arbitrary request headers using $REQUEST_HEADER["..."]. GetLighttpd to use lighttpd git master.