语言

HttpWebRequestElement.UseUnsafeHeaderParsing 属性

定义

设置此属性将忽略 HTTP 分析期间发生的验证错误。

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

属性值

指示是否已设置此属性的布尔值。

属性

注解

如果此属性设置为 false,在 HTTP 分析期间将执行以下验证:

  • 在行尾代码中,使用 CRLF;不允许单独使用 CR 或 LF。

  • 标头名称中不应有空格。

  • 如果存在多个状态行,则所有其他状态行都被视为格式不正确的标头名称/值对。

  • 除了状态代码之外,状态行还必须具有状态说明。

  • 标头名称中不能有非 ASCII 字符。 无论此属性是设置为 true 还是 false。

发生协议冲突时,将引发状态设置为 /> 的异常。 UseUnsafeHeaderParsing如果该属性设置为true,则会忽略验证错误。

将此属性设置为 true 具有安全影响,因此仅当需要与服务器向后兼容时,才应执行此操作。

适用于