ForwardedHeadersExtensions.UseForwardedHeaders Method

Definition

Overloads

UseForwardedHeaders(IApplicationBuilder)

Applies forwarded headers to their matching fields on the current request.

By convention, HTTP proxies forward information from the client in well-known HTTP headers. The ForwardedHeadersMiddleware reads these headers and fills in the associated fields on HttpContext.

UseForwardedHeaders(IApplicationBuilder, ForwardedHeadersOptions)

Applies forwarded headers to their matching fields on the current request.

By convention, HTTP proxies forward information from the client in well-known HTTP headers. The ForwardedHeadersMiddleware reads these headers and fills in the associated fields on HttpContext.

UseForwardedHeaders(IApplicationBuilder)

Source:
ForwardedHeadersExtensions.cs
Source:
ForwardedHeadersExtensions.cs
Source:
ForwardedHeadersExtensions.cs

Applies forwarded headers to their matching fields on the current request.

By convention, HTTP proxies forward information from the client in well-known HTTP headers. The ForwardedHeadersMiddleware reads these headers and fills in the associated fields on HttpContext.

C#
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseForwardedHeaders (this Microsoft.AspNetCore.Builder.IApplicationBuilder builder);

Parameters

Returns

A reference to builder after the operation has completed.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

UseForwardedHeaders(IApplicationBuilder, ForwardedHeadersOptions)

Source:
ForwardedHeadersExtensions.cs
Source:
ForwardedHeadersExtensions.cs
Source:
ForwardedHeadersExtensions.cs

Applies forwarded headers to their matching fields on the current request.

By convention, HTTP proxies forward information from the client in well-known HTTP headers. The ForwardedHeadersMiddleware reads these headers and fills in the associated fields on HttpContext.

C#
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseForwardedHeaders (this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, Microsoft.AspNetCore.Builder.ForwardedHeadersOptions options);

Parameters

options
ForwardedHeadersOptions

Enables the different forwarding options.

Returns

A reference to builder after the operation has completed.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0