ForwardedHeadersExtensions.UseForwardedHeaders 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
UseForwardedHeaders(IApplicationBuilder) |
将转发的标头应用于当前请求上的匹配字段。 按照约定,HTTP 代理在已知的 HTTP 标头中转发来自客户端的信息。 读取 ForwardedHeadersMiddleware 这些标头并填充 HttpContext 上的关联字段。 |
UseForwardedHeaders(IApplicationBuilder, ForwardedHeadersOptions) |
将转发的标头应用于当前请求上的匹配字段。 按照约定,HTTP 代理在已知的 HTTP 标头中转发来自客户端的信息。 读取 ForwardedHeadersMiddleware 这些标头并填充 HttpContext 上的关联字段。 |
UseForwardedHeaders(IApplicationBuilder)
将转发的标头应用于当前请求上的匹配字段。
按照约定,HTTP 代理在已知的 HTTP 标头中转发来自客户端的信息。 读取 ForwardedHeadersMiddleware 这些标头并填充 HttpContext 上的关联字段。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseForwardedHeaders(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ builder);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseForwardedHeaders (this Microsoft.AspNetCore.Builder.IApplicationBuilder builder);
static member UseForwardedHeaders : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseForwardedHeaders (builder As IApplicationBuilder) As IApplicationBuilder
参数
- builder
- IApplicationBuilder
返回
操作完成后对 builder
的引用。
适用于
UseForwardedHeaders(IApplicationBuilder, ForwardedHeadersOptions)
将转发的标头应用于当前请求上的匹配字段。
按照约定,HTTP 代理在已知的 HTTP 标头中转发来自客户端的信息。 读取 ForwardedHeadersMiddleware 这些标头并填充 HttpContext 上的关联字段。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseForwardedHeaders(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ builder, Microsoft::AspNetCore::Builder::ForwardedHeadersOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseForwardedHeaders (this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, Microsoft.AspNetCore.Builder.ForwardedHeadersOptions options);
static member UseForwardedHeaders : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Builder.ForwardedHeadersOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseForwardedHeaders (builder As IApplicationBuilder, options As ForwardedHeadersOptions) As IApplicationBuilder
参数
- builder
- IApplicationBuilder
- options
- ForwardedHeadersOptions
启用不同的转发选项。
返回
操作完成后对 builder
的引用。