Re: HttpWebRequest and headers with only newline

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Mikael Svenson (mikaels_at_powertech.no)
Date: 03/04/05


Date: Fri, 04 Mar 2005 10:52:46 +0100

To those who are curious to the solution this is what I got from
Microsoft:

Add this to your config file:

        <system.net>
                <settings>
                        <httpWebRequest useUnsafeHeaderParsing="true" />
                </settings>
        </system.net>

-m

Mikael Svenson wrote:
>
> Is there any way I can get the HttpWebRequest object to accept headers
> with only \n in them?
>
> When I go towards a particular url I get a ProtocolViolation error when
> the headers in the received data only has \n to separate the fields.
>
> If I make me a proxy and intercept the packets and change the \n to \r\n
> it works just fine.
>
> It seems to me that it's a bit strict to assume \r\n on http headers.
>
> The same code works fine under Mono, so guess the Unix guys are a bit
> more "forgiving" on these issues since \n is more unix like.
>
> It's a bit hackish in my opinion to implement a proxy in order to get
> this to work.
>
> If anyone want the example url feel free to contact me.
>
> -m



Relevant Pages

  • Re: [SLE] SpamAssassin
    ... config file. ... Should I have the user shell in and do this themselves ... Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com ...
    (SuSE)
  • Re: [SLE] Ensuring wlan connection is encrypted
    ... Are your cards capable of using 128 bit keys as per your config file? ... Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com ...
    (SuSE)
  • [SLE] mouse wheel
    ... however config file looks ok ... Check the headers for your unsubscription address ... For additional commands send e-mail to suse-linux-e-help@suse.com ...
    (SuSE)
  • Re: [SLE] vsftpd
    ... are you allowing local users to login to your box or is it an anonymous server. ... respond with your config file or this link might help out a little. ... Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com ...
    (SuSE)
  • Re: [SLE] signcode.exe and more
    ... This could have given you a hint:) Looks like these all belong to Mono, ... an open source implementation of .NET. ... Philipp ... Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com ...
    (SuSE)