From c76d0e4ab363b82949113fa5370c462c9679b151 Mon Sep 17 00:00:00 2001 From: yhirose Date: Sun, 10 Dec 2017 22:42:11 -0500 Subject: [PATCH] Allow leading and trailing whilespaces before/after header field values --- httplib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index f72c9b4..eaf701c 100644 --- a/httplib.h +++ b/httplib.h @@ -598,7 +598,7 @@ inline int get_header_value_int(const Headers& headers, const char* key, int def inline bool read_headers(Stream& strm, Headers& headers) { - static std::regex re("(.+?): (.+?)\r\n"); + static std::regex re(R"((.+?):\s*(.+?)\s*\r\n)"); const auto bufsiz = 2048; char buf[bufsiz];