HTTP: fix header parsing

This commit is contained in:
Přemysl Eric Janouch 2017-02-06 18:25:55 +01:00
parent 8ed708106b
commit 8f9e2e6bdf
Signed by: p
GPG Key ID: B715679E3A361BE6

View File

@ -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);