HttpWebRequestElement.UseUnsafeHeaderParsing Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Setting this property ignores validation errors that occur during HTTP parsing.
public:
property bool UseUnsafeHeaderParsing { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("useUnsafeHeaderParsing", DefaultValue=false)]
public bool UseUnsafeHeaderParsing { get; set; }
[<System.Configuration.ConfigurationProperty("useUnsafeHeaderParsing", DefaultValue=false)>]
member this.UseUnsafeHeaderParsing : bool with get, set
Public Property UseUnsafeHeaderParsing As Boolean
Boolean that indicates whether this property has been set.
- Attributes
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
orfalse
.
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.
Product | Versions |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: