From 48180b07ee949a9ddda1063815ce1da403d63e8a Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 20 Nov 2019 15:09:00 +0100 Subject: [PATCH] YAHTTP: Accept headers without spaces --- ext/yahttp/yahttp/reqresp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/yahttp/yahttp/reqresp.cpp b/ext/yahttp/yahttp/reqresp.cpp index beeb4d5020..686a6c7bdf 100644 --- a/ext/yahttp/yahttp/reqresp.cpp +++ b/ext/yahttp/yahttp/reqresp.cpp @@ -101,10 +101,11 @@ namespace YaHTTP { break; } // split headers - if ((pos1 = line.find(": ")) == std::string::npos) + if ((pos1 = line.find(":")) == std::string::npos) { throw ParseError("Malformed header line"); + } key = line.substr(0, pos1); - value = line.substr(pos1+2); + value = line.substr(pos1 + 1); for(std::string::iterator it=key.begin(); it != key.end(); it++) if (YaHTTP::isspace(*it)) throw ParseError("Header key contains whitespace which is not allowed by RFC"); -- 2.47.2