Browse Source

don't crash if Host: is not set

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@885 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.11
Jan Kneschke 16 years ago
parent
commit
3faefdbaf1
  1. 4
      src/mod_proxy.c

4
src/mod_proxy.c

@ -439,7 +439,9 @@ static int proxy_create_env(server *srv, handler_ctx *hctx) {
BUFFER_APPEND_STRING_CONST(b, " HTTP/1.0\r\n");
proxy_append_header(con, "X-Forwarded-For", (char *)inet_ntop_cache_get_ip(srv, &(con->dst_addr)));
proxy_set_header(con, "X-Host", con->request.http_host->ptr);
if (!buffer_is_empty(con->request.http_host)) {
proxy_set_header(con, "X-Host", con->request.http_host->ptr);
}
proxy_set_header(con, "X-Forwarded-Proto", con->conf.is_ssl ? "https" : "http");
/* request header */

Loading…
Cancel
Save