Re: The server committed an HTTP protocol violation
From: Feroze [msft] (ferozed_at_online.microsoft.com)
Date: 01/13/05
- Next message: mboizeau_at_free.fr: "Re: Native C# exe's"
- Previous message: Bruce Wood: "Re: Getting an object's superclass(es)?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 Jan 2005 15:00:32 -0800
It would help if you can take an Ethereal or Netmon capture of the
transaction, with the config setting turned off.
-- feroze ----------------- This posting is provided as-is. It offers no warranties and assigns no rights. See http://weblogs.asp.net/feroze_daud for System.Net related posts. ---------------- "mphacker" <mphacker@sitedevelopers.com> wrote in message news:1102878002.494667.91940@f14g2000cwb.googlegroups.com... > I ran into a problem using the HttpWebRequest / HttpWebResponse objects > to retrieve information from a Linksys router. > > Whenever I try to connect to the router I receive the error "The server > committed an HTTP protocol violation". After doing some reasearch I > found out that in the 1.1 sp1 of the .NET Framework there is a security > check for invalid http headers. If an invalid header is found, then > this error is thrown. > > There is a work around, which is to add the following to the > applications config file: > > <configuration> > <system.net> > <settings> > <httpWebRequest useUnsafeHeaderParsing="true" /> > </settings> > </system.net> > </configuration> > > After adding the lines to the application configuration, I can now read > the Linksys router's webpage. If I use the response objects > .Headers.ToString() I get the following: > > "Content-type: text/html\r\nCache-Control: no-cache\r\nPragma: > no-cache\r\nExpires: Sun, 12 Dec 2004 18:44:36 GMT\r\nDate: Sun, 12 Dec > 2004 18:44:36 GMT\r\nAccept-Ranges: bytes\r\nConnection: close\r\n\r\n" > > I am not seeing any problems with the header. Am I missing something? > I would like to track down the issue so I can report it to either > Linksys or Microsoft so that the problem can be resolved. I don't > want to open up any security holes in my app by allowing unsafe header > parsing. > > Thanks! >
- Next message: mboizeau_at_free.fr: "Re: Native C# exe's"
- Previous message: Bruce Wood: "Re: Getting an object's superclass(es)?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|