Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtendedHttpWebRequest Issue #3

Closed
paulushub opened this issue Nov 29, 2017 · 5 comments
Closed

ExtendedHttpWebRequest Issue #3

paulushub opened this issue Nov 29, 2017 · 5 comments

Comments

@paulushub
Copy link
Contributor

paulushub commented Nov 29, 2017

Hi there,
 
I have seen that you are using your ExtendedHttpWebRequest class to handle some features. I have a problem with this class, because it has broken my code. I have written the small example to explain my problem:
 
class Program
{
static void Main(string[] args)
{
// Everything works ok, here
{
WebRequest request = WebRequest.Create("http://google.com");
var httpRequest = (HttpWebRequest)request;
}

 
// Css document object is created
CssXmlDocument doc = new CssXmlDocument();

 
// InvalidCastException appears here
{
WebRequest request = WebRequest.Create("http://google.com");
var httpRequest = (HttpWebRequest)request;
}
}
}

 
This problem occurs because in CssXmlDocument there is following code:
SharpVectors.Net.ExtendedHttpWebRequest.Register();
SharpVectors.Net.DataWebRequest.Register();

 
I believe it is a bug, because HTTP and HTTPS schemes handling is implemented in .NET and in MSDN it is written: "The HttpWebRequest class is registered to service requests for HTTP and HTTPS schemes by default. Attempts to register a different WebRequest descendant for these schemes will fail.". This is certainly false, nevertheless these two schemes should not be overriden.

This work item was migrated from CodePlex

CodePlex work item ID: '390'
Vote count: '2'

@paulushub
Copy link
Contributor Author

[SelormeyPaul@2011/01/27]
Thanks for this report. I will see how best to resolve it before the release.

@paulushub
Copy link
Contributor Author

[UnknownUser@2011/02/12]

@paulushub
Copy link
Contributor Author

[UnknownUser@2013/02/14]

@paulushub
Copy link
Contributor Author

[UnknownUser@2013/05/16]

@paulushub
Copy link
Contributor Author

Issue closed by SelormeyPaul with comment
This is fixed in the Change Set #5704. Thank you for reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant