mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 22:24:44 +02:00
Merge pull request #5995 from Icinga/fix/influxdb-requests
Fix InfluxDB requests
This commit is contained in:
commit
71a032579b
@ -321,6 +321,9 @@ String InfluxdbWriter::EscapeValue(const Value& value)
|
|||||||
if (value.IsBoolean())
|
if (value.IsBoolean())
|
||||||
return value ? "true" : "false";
|
return value ? "true" : "false";
|
||||||
|
|
||||||
|
if (value.IsString())
|
||||||
|
return "\"" + EscapeKeyOrTagValue(value) + "\"";
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,6 +207,11 @@ bool HttpResponse::Parse(StreamReadContext& src, bool may_wait)
|
|||||||
lengthIndicator = Convert::ToLong(contentLengthHeader);
|
lengthIndicator = Convert::ToLong(contentLengthHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!hasLengthIndicator && ProtocolVersion != HttpVersion10 && !Headers->Contains("transfer-encoding")) {
|
||||||
|
Complete = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (hasLengthIndicator && src.Eof)
|
if (hasLengthIndicator && src.Eof)
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user