Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HttpWebRequest.GetResponse Error and useUnsafeHeaderParsing

15 views
Skip to first unread message

MikeZ

unread,
Jan 4, 2006, 11:19:22 AM1/4/06
to
I post this question last week, no good answer, so I post again. Sorry about
this.

I use WebRequest.Create/WebRequest.GetResponse to handle HTTP request in a
VS2003 project. I got HTTP violation exception on some of the machine. So I
did the research, and found to put <useUnsafeHeaderParsing ="true"> in
app.config can fix the problem. The machines have framework 1.1 installed,
even useUnsafeHeaderParsing is an attribute of version 2.0

Here is the detailed of error:
The server committed an HTTP protocol violation.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()

But the app.config cause problem on other machines which work fine without
application config file. The exception is <Unrecognized attribute
'useUnsafeHeaderParsing'>. I use framework1.1 on this machine. Install
framework2.0 did not fix the problem.

I converted project to VS2005, it is OK to put the application config in all
PCs.

Because my application will distribute to other user's machines, the users
is not IT professional. And I don't want to convert the project to VS2005
now, any solutions to fix the problem in VS2003?

Thanks.

Joerg Jooss

unread,
Jan 4, 2006, 6:19:35 PM1/4/06
to
Hello MikeZ,

> I post this question last week, no good answer, so I post again. Sorry
> about this.
>
> I use WebRequest.Create/WebRequest.GetResponse to handle HTTP request
> in a VS2003 project. I got HTTP violation exception on some of the
> machine. So I did the research, and found to put
> <useUnsafeHeaderParsing ="true"> in app.config can fix the problem.

Aahh, that's not a fix but a security hole. You're receiving illegal HTTP
header content.

> The machines have framework 1.1 installed, even useUnsafeHeaderParsing
> is an attribute of version 2.0

No, it was introduced in .NET 1.1 SP1 and kept secret ;-)
See http://support.microsoft.com/kb/888528/en-us

> Here is the detailed of error:
> The server committed an HTTP protocol violation.
> at System.Net.HttpWebRequest.CheckFinalStatus()
> at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult
> asyncResult)
> at System.Net.HttpWebRequest.GetResponse()
> But the app.config cause problem on other machines which work fine
> without application config file. The exception is <Unrecognized
> attribute 'useUnsafeHeaderParsing'>. I use framework1.1 on this
> machine. Install framework2.0 did not fix the problem.

Do these have SP1 installed?

Cheers,
--
Joerg Jooss
news-...@joergjooss.de


0 new messages