diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2005-06-04 02:16:07 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2005-06-04 02:16:07 +0400 |
commit | d2cccf33e6817990d1039e680728d5d295e604eb (patch) | |
tree | d9de0a3e651ca07cdeb3aa1b4684a0c3d7d59885 | |
parent | 1afaea4eba7fb58387eebc59ad7e7a43753441ce (diff) |
2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* HttpWebRequest.cs: send the right header/user/password in
PreAuthenticate in presence of a proxy.
svn path=/branches/mono-1-1-7/mcs/; revision=45391
-rw-r--r-- | mcs/class/System/System.Net/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System/System.Net/HttpWebRequest.cs | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog index 4ea7daf92e1..f32fe1530a0 100644 --- a/mcs/class/System/System.Net/ChangeLog +++ b/mcs/class/System/System.Net/ChangeLog @@ -1,5 +1,10 @@ 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com> + * HttpWebRequest.cs: send the right header/user/password in + PreAuthenticate in presence of a proxy. + +2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com> + * ServicePointManager.cs: when going through a proxy, use 2 different service points depending on the scheme. Fixes bug #75135. diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs index 5f108fcf88a..1f4ee5af8cd 100644 --- a/mcs/class/System/System.Net/HttpWebRequest.cs +++ b/mcs/class/System/System.Net/HttpWebRequest.cs @@ -896,12 +896,12 @@ namespace System.Net webHeaders.RemoveInternal ("Proxy-Authorization"); webHeaders.RemoveInternal ("Authorization"); bool isProxy = (proxy != null && !proxy.IsBypassed (actualUri)); - ICredentials creds = (!isProxy) ? credentials : proxy.Credentials; + ICredentials creds = (!isProxy || credentials != null) ? credentials : proxy.Credentials; Authorization auth = AuthenticationManager.PreAuthenticate (this, creds); if (auth == null) return; - string authHeader = (isProxy) ? "Proxy-Authorization" : "Authorization"; + string authHeader = (isProxy && credentials == null) ? "Proxy-Authorization" : "Authorization"; webHeaders [authHeader] = auth.Message; usedPreAuth = true; } |