From 0cc98fc161f86765524e7d53ac0fb6a2196cf9af Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 1 Jul 2013 16:20:54 +0200 Subject: [PATCH] filter_http_rewrite: don't crash if "Host" header is missing --- src/filter_http_rewrite.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 1.7.10.4