Skip to content

Commit 36188bc

Browse files
committed
Fix remaining rate limit parsing when using different culture
1 parent 1fdb759 commit 36188bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

RedditSharp/RateLimitManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.Linq;
45
using System.Net.Http;
56
using System.Threading;
@@ -177,7 +178,7 @@ public async Task ReadHeadersAsync(HttpResponseMessage response)
177178
}
178179
if (headers.TryGetValues("X-Ratelimit-Remaining", out values))
179180
{
180-
remaining = (int)double.Parse(values.First());
181+
remaining = (int)double.Parse(values.First(), CultureInfo.InvariantCulture);
181182
}
182183
else
183184
{

0 commit comments

Comments
 (0)