Removed Header overflow

This commit is contained in:
Johnny @PC 2015-02-21 18:38:47 +01:00
parent 1f359dfa74
commit bf0db02e91

View File

@ -345,8 +345,8 @@ namespace SpotifyAPI.SpotifyWebAPI
{ {
if (!UseAuth) if (!UseAuth)
throw new Exception("UseAuth required for 'UploadData'"); throw new Exception("UseAuth required for 'UploadData'");
webclient.Headers.Add("Authorization", TokenType + " " + AccessToken); webclient.Headers.Set("Authorization", TokenType + " " + AccessToken);
webclient.Headers.Add("Content-Type", "application/json"); webclient.Headers.Set("Content-Type", "application/json");
String response = ""; String response = "";
try try
{ {
@ -367,7 +367,9 @@ namespace SpotifyAPI.SpotifyWebAPI
public String DownloadString(String url) public String DownloadString(String url)
{ {
if (UseAuth) if (UseAuth)
webclient.Headers.Add("Authorization", TokenType + " " + AccessToken); webclient.Headers.Set("Authorization", TokenType + " " + AccessToken);
else if (!UseAuth && webclient.Headers["Authorization"] != null)
webclient.Headers.Remove("Authorization");
String response = ""; String response = "";
try try
{ {