Skip to content

Commit 605eb58

Browse files
authored
Always use '.' as decimal separator (getsentry#2445)
1 parent 90e9f04 commit 605eb58

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Sentry/Internal/Extensions/JsonExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public static void Deconstruct(this JsonProperty jsonProperty, out string name,
180180

181181
// Otherwise, let's get the value as a string and parse it ourselves.
182182
// Note that we already know this will succeed due to JsonValueKind.Number
183-
return double.Parse(json.ToString()!);
183+
return double.Parse(json.ToString()!, CultureInfo.InvariantCulture);
184184
}
185185

186186
public static long? GetAddressAsLong(this JsonElement json)

src/Sentry/Internal/Http/RetryAfterHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private DateTimeOffset GetRetryAfterTimestamp(HttpResponseMessage response)
8585
// Sentry was sending floating point numbers which are not handled by RetryConditionHeaderValue
8686
// To be compatible with older versions of sentry on premise: https://github.com/getsentry/sentry/issues/7919
8787
if (response.Headers.TryGetValues("Retry-After", out var values)
88-
&& double.TryParse(values.FirstOrDefault(), out var retryAfterSeconds))
88+
&& double.TryParse(values.FirstOrDefault(), NumberStyles.Float | NumberStyles.AllowThousands, CultureInfo.InvariantCulture, out var retryAfterSeconds))
8989
{
9090
return _clock.GetUtcNow().AddTicks((long)(retryAfterSeconds * TimeSpan.TicksPerSecond));
9191
}

0 commit comments

Comments
 (0)