rewrite: do not even compare content types, if we don't have any
authorHeikki Levanto <heikki@indexdata.dk>
Fri, 2 Aug 2013 12:21:54 +0000 (14:21 +0200)
committerHeikki Levanto <heikki@indexdata.dk>
Fri, 2 Aug 2013 12:21:54 +0000 (14:21 +0200)
the regex_match caused a segfault if we had no content-type in the
headers.

src/filter_http_rewrite.cpp

index 6cdc57c..58243bf 100644 (file)
@@ -275,6 +275,10 @@ void yf::HttpRewrite::Phase::rewrite_body(
 {
     if (*content_len == 0)
         return;
+    if (!content_type) {
+        yaz_log(YLOG_LOG, "rewrite_body: null content_type, can not rewrite");
+        return;
+    }
     std::list<Content>::const_iterator cit = content_list.begin();
     for (; cit != content_list.end(); cit++)
     {