Переглянути джерело

[webclient] Only set the credentials when they are not null.

	Setting the credentials to null makes FtpWebRequest throw.
	Fixes bug #688007.
Gonzalo Paniagua Javier 14 роки тому
батько
коміт
5fbcc7cd2d
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      mcs/class/System/System.Net/WebClient.cs

+ 2 - 1
mcs/class/System/System.Net/WebClient.cs

@@ -789,7 +789,8 @@ namespace System.Net
 			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?