My App.config file
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
</configuration>
I was facing the below error when I was trying to download some .pdf file from a url.
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
After extensive research, most of the suggestions are to add useUnsafeHeaderParsing="true" in config file, but unfortunately it was already present in my config file.
But I realized that, all the examples in suggested solutions are not having this particular line
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
So I went ahead and removed and tried to download the .pdf file
<?xml version="1.0"?>
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
</configuration>
and it worked. My application is built using .Net Framework 4
What I am trying to understand is there any impact of removing this line, or it can fixed in some other way ?