.net standard 2.0 support, followup #475

This commit is contained in:
Jonas Dellinger 2020-07-03 23:06:54 +02:00
parent d7baa8f45c
commit ea8fccd555

View File

@ -58,8 +58,8 @@ namespace SpotifyAPI.Web
return null; return null;
} }
if ( if (
int.TryParse(response.Headers.GetValueOrDefault("Retry-After"), out int secondsToWait) (response.Headers.ContainsKey("Retry-After") && int.TryParse(response.Headers["Retry-After"], out int secondsToWait))
|| int.TryParse(response.Headers.GetValueOrDefault("retry-after"), out secondsToWait)) || (response.Headers.ContainsKey("retry-after") && int.TryParse(response.Headers["retry-after"], out secondsToWait)))
{ {
return TimeSpan.FromSeconds(secondsToWait); return TimeSpan.FromSeconds(secondsToWait);
} }