From: Marc Cromme Date: Sat, 31 Mar 2007 20:27:15 +0000 (+0000) Subject: adjusting HTTP headers to be conformant with Upper-Case-Style X-Git-Tag: PAZPAR2.1.0.0~376 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=c99908a4b07dafc96ee813375971fd9b589bc551;p=pazpar2-moved-to-github.git adjusting HTTP headers to be conformant with Upper-Case-Style taking correct server->host parameter for 'Via:' and 'X-Pazpar2-Server-Host:' Header. --- diff --git a/src/http.c b/src/http.c index 61d3fd9..98b9489 100644 --- a/src/http.c +++ b/src/http.c @@ -1,5 +1,5 @@ /* - * $Id: http.c,v 1.19 2007-03-31 20:06:18 marc Exp $ + * $Id: http.c,v 1.20 2007-03-31 20:27:15 marc Exp $ */ #include @@ -610,20 +610,16 @@ static int http_proxy(struct http_request *rq) { hp = rq->headers; hp = http_header_append(c, hp, - PACKAGE_NAME "-version", PACKAGE_VERSION); + "X-Pazpar2-Version", PACKAGE_VERSION); hp = http_header_append(c, hp, - PACKAGE_NAME "-server-host", ser->myurl); + "X-Pazpar2-Server-Host", ser->host); sprintf(server_port, "%d", ser->port); hp = http_header_append(c, hp, - PACKAGE_NAME "-server-port", server_port); + "X-Pazpar2-Server-Port", server_port); sprintf(server_via, "1.1 %s:%s (%s/%s)", - ser->myurl, server_port, PACKAGE_NAME, PACKAGE_VERSION); - hp = http_header_append(c, hp, - "Via" , server_via); - //hp = http_header_append(c, hp,"Client-ip", - // c->iochan->addr_str); - hp = http_header_append(c, hp,"X-Forwarded-For", - c->iochan->addr_str); + ser->host, server_port, PACKAGE_NAME, PACKAGE_VERSION); + hp = http_header_append(c, hp, "Via" , server_via); + hp = http_header_append(c, hp,"X-Forwarded-For", c->iochan->addr_str); } requestbuf = http_serialize_request(rq);