Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 UseUnsafeHeaderParsing Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
HttpWebRequestElement..::.UseUnsafeHeaderParsing Property

Setting this property ignores validation errors that occur during HTTP parsing.

Namespace:  System.Net.Configuration
Assembly:  System (in System.dll)
Visual Basic (Declaration)
<ConfigurationPropertyAttribute("useUnsafeHeaderParsing", DefaultValue := False)> _
Public Property UseUnsafeHeaderParsing As Boolean
Visual Basic (Usage)
Dim instance As HttpWebRequestElement
Dim value As Boolean

value = instance.UseUnsafeHeaderParsing

instance.UseUnsafeHeaderParsing = value
C#
[ConfigurationPropertyAttribute("useUnsafeHeaderParsing", DefaultValue = false)]
public bool UseUnsafeHeaderParsing { get; set; }
Visual C++
[ConfigurationPropertyAttribute(L"useUnsafeHeaderParsing", DefaultValue = false)]
public:
property bool UseUnsafeHeaderParsing {
    bool get ();
    void set (bool value);
}
JScript
public function get UseUnsafeHeaderParsing () : boolean
public function set UseUnsafeHeaderParsing (value : boolean)

Property Value

Type: System..::.Boolean
Boolean that indicates whether this property has been set.

When this property is set to false, the following validations are performed during HTTP parsing:

  • In end-of-line code, use CRLF; using CR or LF alone is not allowed.

  • Headers names should not have spaces in them.

  • If multiple status lines exist, all additional status lines are treated as malformed header name/value pairs.

  • The status line must have a status description, in addition to a status code.

  • Header names cannot have non-ASCII chars in them. This validation is performed whether this property is set to true or false.

When a protocol violation occurs, a WebException exception is thrown with the status set to ServerProtocolViolation. If the UseUnsafeHeaderParsing property is set to true, validation errors are ignored.

Setting this property to true has security implications, so it should only be done if backward compatibility with a server is required.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker