From: Adam Dickmeiss Date: Mon, 1 Jul 2013 14:20:54 +0000 (+0200) Subject: filter_http_rewrite: don't crash if "Host" header is missing X-Git-Tag: v1.3.59~27 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=0cc98fc161f86765524e7d53ac0fb6a2196cf9af;p=metaproxy-moved-to-github.git filter_http_rewrite: don't crash if "Host" header is missing --- diff --git a/src/filter_http_rewrite.cpp b/src/filter_http_rewrite.cpp index bb03d67..d417f46 100644 --- a/src/filter_http_rewrite.cpp +++ b/src/filter_http_rewrite.cpp @@ -156,8 +156,12 @@ void yf::HttpRewrite::Phase::rewrite_reqline (mp::odr & o, else { //TODO what about proto + const char *host = z_HTTP_header_lookup(hreq->headers, "Host"); + if (!host) + return; + path += "http://"; - path += z_HTTP_header_lookup(hreq->headers, "Host"); + path += host; path += hreq->path; }