Re: The server committed an HTTP protocol violation

From: Feroze [msft] (ferozed_at_online.microsoft.com)
Date: 01/13/05


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!
>


Relevant Pages

  • The server committed an HTTP protocol violation
    ... I ran into a problem using the HttpWebRequest / HttpWebResponse objects ... to retrieve information from a Linksys router. ... I am not seeing any problems with the header. ...
    (microsoft.public.dotnet.csharp.general)
  • Summary: DNS problem on Solaris 9
    ... difference between my working server and the one I have here. ... > HEADER: ... > AUTHORITY RECORDS: ... Here is my config. ...
    (SunManagers)
  • Re: Which router For Linux MDK 9.2
    ... Are you using it with MDK 9.2? ... > using to access it's HTML config page? ... license codes. ... through Linksys, not direct, and that the "wrong" valid license code would ...
    (comp.os.linux.misc)
  • Re: Error in MAKE CONFIG
    ... > drivers on them but I don't know what to do from here on out. ... > rule to make target 'config'. ... Or contacted Netwave and/or Linksys? ... The problem with the world is stupidity. ...
    (alt.os.linux)
  • Re: Think I made a mistake
    ... so probably some wrong computer config. ... took it back and got the linksys usb. ... No way, it finds the Linksys, good connection, but will ...
    (alt.internet.wireless)