Skip to content

Commit

Permalink
[webclient] Only set the credentials when they are not null.
Browse files Browse the repository at this point in the history
	Setting the credentials to null makes FtpWebRequest throw.
	Fixes bug #688007.
  • Loading branch information
gonzalop committed Apr 17, 2011
1 parent b805272 commit 5f8f481
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mcs/class/System/System.Net/WebClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,8 @@ WebRequest SetupRequest (Uri uri)
WebRequest request = GetWebRequest (uri);
if (Proxy != null)
request.Proxy = Proxy;
request.Credentials = credentials;
if (credentials != null)
request.Credentials = credentials;

// Special headers. These are properties of HttpWebRequest.
// What do we do with other requests differnt from HttpWebRequest?
Expand Down

0 comments on commit 5f8f481

Please sign in to comment.