]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
YAHTTP: Accept headers without spaces 8562/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 20 Nov 2019 14:09:00 +0000 (15:09 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 20 Nov 2019 14:17:07 +0000 (15:17 +0100)
ext/yahttp/yahttp/reqresp.cpp

index beeb4d50204594254fde8d201bec15b2aa03bf6c..686a6c7bdfbfd6b6c5d9a2f6da6dd1d1eae3d7d0 100644 (file)
@@ -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");