mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 22:56:25 +00:00
Clear DefaultRequestHeaders when adding a new header dictionary (#302)
This commit is contained in:
parent
9859e9d4ae
commit
467984c6f8
@ -166,12 +166,9 @@ namespace SpotifyAPI.Web
|
||||
|
||||
private void AddHeaders(Dictionary<string,string> headers)
|
||||
{
|
||||
_client.DefaultRequestHeaders.Clear();
|
||||
foreach (KeyValuePair<string, string> headerPair in headers)
|
||||
{
|
||||
if (_client.DefaultRequestHeaders.Contains(headerPair.Key))
|
||||
{
|
||||
_client.DefaultRequestHeaders.Remove(headerPair.Key);
|
||||
}
|
||||
_client.DefaultRequestHeaders.TryAddWithoutValidation(headerPair.Key, headerPair.Value);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user