From 0b590c923e8dd9e576b1e52f73aa60647f27658c Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Mon, 24 Oct 2022 20:25:56 +0200 Subject: [PATCH] Minor fixup for request line --- src/HttpParser.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HttpParser.h b/src/HttpParser.h index 61e3b1b..55d558e 100644 --- a/src/HttpParser.h +++ b/src/HttpParser.h @@ -193,7 +193,7 @@ private: } static inline bool hasLess(uint64_t word) { - return word - ~0UL / 255 * 32 & ~word & ~0UL / 255 * 128; + return (word - ~0UL / 255 * 32) & ~word & ~0UL / 255 * 128; } static inline void *find_less(char *p, char */*end*/) { @@ -242,8 +242,8 @@ private: if (postPaddedBuffer[0] == ':' && postPaddedBuffer[1] == ' ') { postPaddedBuffer += 2; } else { - /* We should not accept whitespace between key and colon */ - if (postPaddedBuffer[0] != ':') { + /* We should not accept whitespace between key and colon (unless on request line) */ + if (i && postPaddedBuffer[0] != ':') { return 0; } /* Trim until value starts */