This project has moved and is read-only. For the latest updates, please go here.
1
Vote

HtmlWeb Ignores Credentials

description

If you pass a NetworkCredential but not a WebProxy to the Load method, the credentials are ignored.

To reproduce:
var web = new HtmlWeb();
var credentials = new NetworkCredential(...);
web.Load(url, method, null, credentials);
The problem is in the private private HttpStatusCode Get(Uri uri, string method, string path, HtmlDocument doc, IWebProxy proxy, ICredentials creds) method.

Since the Load method requires a WebProxy instance instead of an IWebProxy instance, there is no way to pass the default proxy without calling a method which has been obsolete since .NET 2.0!

comments