From cefb0f7aedb9e3f0a2c04e7258ab07a243638e75 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sun, 19 Aug 2012 08:11:16 +0200 Subject: [PATCH] htparser: Made HTTP version recognition case-independent. --- src/htparser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/htparser.c b/src/htparser.c index 4086f79..c9cc97c 100644 --- a/src/htparser.c +++ b/src/htparser.c @@ -274,7 +274,7 @@ void serve(FILE *in, struct conn *conn) if(!getheader(resp, "server")) headappheader(resp, "Server", sprintf3("ashd/%s", VERSION)); - if(!strcmp(req->ver, "HTTP/1.0")) { + if(!strcasecmp(req->ver, "HTTP/1.0")) { if(!strcasecmp(req->method, "head")) { keep = http10keep(req, resp); writeresp(in, resp); @@ -295,7 +295,7 @@ void serve(FILE *in, struct conn *conn) } if(!keep) break; - } else if(!strcmp(req->ver, "HTTP/1.1")) { + } else if(!strcasecmp(req->ver, "HTTP/1.1")) { if(!strcasecmp(req->method, "head")) { writeresp(in, resp); fprintf(in, "\r\n"); -- 2.11.0