Re: HttpWebRequest and headers with only newline
From: Mikael Svenson (mikaels_at_powertech.no)
Date: 03/04/05
- Next message: Carlos J. Quintero [.NET MVP]: "Re: Opinions on .NET Framework?"
- Previous message: Jason Clark: "How to block on read at eof of a stream"
- In reply to: Mikael Svenson: "HttpWebRequest and headers with only newline"
- Next in thread: Joerg Jooss: "Re: HttpWebRequest and headers with only newline"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Carlos J. Quintero [.NET MVP]: "Re: Opinions on .NET Framework?"
- Previous message: Jason Clark: "How to block on read at eof of a stream"
- In reply to: Mikael Svenson: "HttpWebRequest and headers with only newline"
- Next in thread: Joerg Jooss: "Re: HttpWebRequest and headers with only newline"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|