From 8f9e2e6bdf0e83a2ea90feca8179d6889099998e Mon Sep 17 00:00:00 2001
From: Přemysl Janouch 
Date: Mon, 6 Feb 2017 18:25:55 +0100
Subject: HTTP: fix header parsing
---
 plugins/http.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'plugins')
diff --git a/plugins/http.c b/plugins/http.c
index 35e3d70..cab4246 100644
--- a/plugins/http.c
+++ b/plugins/http.c
@@ -51,7 +51,7 @@ struct scan_data
 static void
 on_header_read (struct scan_data *scan)
 {
-	if (!strcasecmp (scan->field.str, "Server"))
+	if (!strcasecmp_ascii (scan->field.str, "Server"))
 	{
 		char *info = xstrdup_printf ("%s: %s",
 			"server software", scan->value.str);
@@ -88,6 +88,9 @@ static int
 on_headers_complete (http_parser *parser)
 {
 	struct scan_data *scan = parser->data;
+	if (scan->state == STATE_VALUE)
+		on_header_read (scan);
+
 	// We've got this far, this must be an HTTP server
 	g_data.api->unit_set_success (scan->u, true);
 	g_data.api->unit_stop (scan->u);
-- 
cgit v1.2.3-70-g09d2