# Can now specify an additional HTTP header on a per-host basis # to be submitted along with any HTTP requests for that host # # eg, httphdr="X-Forwarded-For: 127.0.0.1" # --- lib/loadhosts.c.httpheaders 2012-02-02 22:49:36.778157917 -0800 +++ lib/loadhosts.c 2012-02-03 20:38:26.061672197 -0800 @@ -126,6 +126,8 @@ xmh_item_name[XMH_DEPENDS] = "XMH_DEPENDS"; xmh_item_key[XMH_BROWSER] = "browser="; xmh_item_name[XMH_BROWSER] = "XMH_BROWSER"; + xmh_item_key[XMH_HTTPHEADERS] = "httphdr="; + xmh_item_name[XMH_HTTPHEADERS] = "XMH_HTTPHEADERS"; xmh_item_key[XMH_HOLIDAYS] = "holidays="; xmh_item_name[XMH_HOLIDAYS] = "XMH_HOLIDAYS"; xmh_item_key[XMH_DELAYRED] = "delayred="; --- lib/loadhosts.h.httpheaders 2012-02-02 22:49:36.760654953 -0800 +++ lib/loadhosts.h 2012-02-03 20:38:39.267759047 -0800 @@ -33,6 +33,7 @@ XMH_SSLMINBITS, XMH_DEPENDS, XMH_BROWSER, + XMH_HTTPHEADERS, XMH_HOLIDAYS, XMH_DELAYRED, XMH_DELAYYELLOW, --- xymonnet/netdialog.c.httpheaders 2012-05-06 07:55:31.000000000 -0700 +++ xymonnet/netdialog.c 2012-05-07 12:41:34.197124881 -0700 @@ -324,6 +324,18 @@ addtobuffer(httprequest, useragent); } + { + char *customhttphdrs = NULL; + + if (hostinfo) customhttphdrs = xmh_item(hostinfo, XMH_HTTPHEADERS); + + if (customhttphdrs) { + char tmpcusthttphdrs[1024]; + + sprintf(tmpcusthttphdrs, "%s\r\n", customhttphdrs); + addtobuffer(httprequest, tmpcusthttphdrs); + } + } if (weburl.desturl->auth) { if (strncmp(weburl.desturl->auth, "CERT:", 5) != 0) { char *s = base64encode(weburl.desturl->auth);