quark

quark web server
git clone git://git.suckless.org/quark
Log | Files | Refs | LICENSE

commit d1589c96fa7b0f4a54340682937727013fee4c84
parent 2021da9bed741788835dab585a8cd24a20f11646
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue, 27 Jun 2017 22:19:27 +0200

header parsing: allow tabs are whitespace, compare case-insensitive

this is more conforming the HTTP spec

Diffstat:
quark.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/quark.c b/quark.c @@ -271,7 +271,7 @@ getrequest(int fd, struct request *r) /* match field type */ for (; *p != '\0';) { for (i = 0; i < NUM_REQ_FIELDS; i++) { - if (!strncmp(p, req_field_str[i], + if (!strncasecmp(p, req_field_str[i], strlen(req_field_str[i]))) { break; } @@ -293,7 +293,7 @@ getrequest(int fd, struct request *r) } /* skip whitespace */ - for (++p; *p == ' '; p++) + for (++p; *p == ' ' || *p == '\t'; p++) ; /* extract field content */