From: Pieter Lexis Date: Wed, 20 Nov 2019 14:09:00 +0000 (+0100) Subject: YAHTTP: Accept headers without spaces X-Git-Tag: auth-4.3.0-alpha1~29^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8562%2Fhead;p=thirdparty%2Fpdns.git YAHTTP: Accept headers without spaces --- 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");