Fix remote web-server crash when sensors contain a "NaN" value. (#2384)

Co-authored-by: Tobias Jüttner <tjuettner@nepatec.de>
This commit is contained in:
tj81
2026-05-21 13:11:53 +02:00
committed by GitHub
co-authored by Tobias Jüttner
parent 469aa97c77
commit 10c4f41376
@@ -534,7 +534,13 @@ public class HttpServer
json["Children"] = new List<object> { GenerateJsonForNode(_root, ref nodeIndex) };
byte[] buffer = Encoding.UTF8.GetBytes(System.Text.Json.JsonSerializer.Serialize(json));
byte[] buffer = Encoding.UTF8.GetBytes(System.Text.Json.JsonSerializer.Serialize(
json,
new System.Text.Json.JsonSerializerOptions
{
NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowNamedFloatingPointLiterals, // Allow "NaN"
}
));
bool acceptGzip;
try