Skip to content

Commit 38842ab

Browse files
committed
Accept header lines missing a space "Key:val"
Workaround for Reolink webhook
1 parent 7adefd6 commit 38842ab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/HTTPConnection.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,12 @@ void HTTPConnection::loop() {
413413
_parserLine.text.substr(idxColon+2)
414414
));
415415
HTTPS_LOGD("Header: %s = %s (FID=%d)", _parserLine.text.substr(0, idxColon).c_str(), _parserLine.text.substr(idxColon+2).c_str(), _socket);
416+
} else if ( (idxColon != std::string::npos) ) {
417+
_httpHeaders->set(new HTTPHeader(
418+
_parserLine.text.substr(0, idxColon),
419+
_parserLine.text.substr(idxColon+1)
420+
));
421+
HTTPS_LOGD("Header: %s = %s (FID=%d)", _parserLine.text.substr(0, idxColon).c_str(), _parserLine.text.substr(idxColon+1).c_str(), _socket);
416422
} else {
417423
HTTPS_LOGW("Malformed request header: %s", _parserLine.text.c_str());
418424
raiseError(400, "Bad Request");

0 commit comments

Comments
 (0)