From 66d8dda0f523abe7be1ad6954af5ef15eb26d1c4 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 11 Jul 2024 21:40:44 +0900 Subject: [PATCH] Timespan in API should be parsed with invariant culture --- BTCPayServer.Client/JsonConverters/TimeSpanJsonConverter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BTCPayServer.Client/JsonConverters/TimeSpanJsonConverter.cs b/BTCPayServer.Client/JsonConverters/TimeSpanJsonConverter.cs index e41a809b7..241c7467f 100644 --- a/BTCPayServer.Client/JsonConverters/TimeSpanJsonConverter.cs +++ b/BTCPayServer.Client/JsonConverters/TimeSpanJsonConverter.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using NBitcoin.JsonConverters; using Newtonsoft.Json; @@ -58,7 +59,7 @@ namespace BTCPayServer.Client.JsonConverters return null; return TimeSpan.Zero; } - if (reader.TokenType == JsonToken.String && TimeSpan.TryParse(reader.Value?.ToString(), out var res)) + if (reader.TokenType == JsonToken.String && TimeSpan.TryParse(reader.Value?.ToString(), CultureInfo.InvariantCulture, out var res)) return res; if (reader.TokenType != JsonToken.Integer) throw new JsonObjectException("Invalid timespan, expected integer", reader);