From: Fredrik Tolf Date: Sun, 19 Aug 2012 06:11:16 +0000 (+0200) Subject: htparser: Made HTTP version recognition case-independent. X-Git-Tag: 0.12~28 X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=commitdiff_plain;h=cefb0f7aedb9e3f0a2c04e7258ab07a243638e75 htparser: Made HTTP version recognition case-independent. --- 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");