aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-02-06 18:25:55 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2017-02-06 18:25:55 +0100
commit8f9e2e6bdf0e83a2ea90feca8179d6889099998e (patch)
tree2b56e3bb19940eb007d407a40a22d6a6551dd77e /plugins
parent8ed708106b09824d4e23759232fb7572f4a276b5 (diff)
downloadponymap-8f9e2e6bdf0e83a2ea90feca8179d6889099998e.tar.gz
ponymap-8f9e2e6bdf0e83a2ea90feca8179d6889099998e.tar.xz
ponymap-8f9e2e6bdf0e83a2ea90feca8179d6889099998e.zip
HTTP: fix header parsing
Diffstat (limited to 'plugins')
-rw-r--r--plugins/http.c5
1 files changed, 4 insertions, 1 deletions
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);