HttpWebRequest.GetResponse Error and useUnsafeHeaderParsing

G

Guest

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.
 
J

Joerg Jooss

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top