6.44Notes on Headers Ignored During Forwarding
Created on Aug 17, 2026~3 min read
When using the HttpContext forwarding feature, the system automatically ignores the following request and response headers to ensure the validity and accuracy of the forwarding:
-
Request headers that will be ignored:
X-Forward-ToHostContent-Length
-
Response headers that will be ignored:
Content-TypeTransfer-EncodingKeep-AliveUpgradeProxy-Connection
If you need to add more settings for ignored request or response headers, you can configure them through HttpContextForwardOptions. There are two configuration approaches:
- Global configuration:
In the project's Startup.cs or Program.cs file, register and configure the service:
services.Configure<HttpContextForwardOptions>(options =>{ // List of request headers to skip during forwarding options.IgnoreRequestHeaders = ["Framework"]; // List of response headers to skip during forwarding options.IgnoreResponseHeaders = ["Content-Length"];});- Per-forward configuration:
For a single forward, you can pass HttpContextForwardOptions for configuration:
httpContext.ForwardAsResult("https://furion.net", forwardOptions: new HttpContextForwardOptions{ // List of request headers to skip during forwarding options.IgnoreRequestHeaders = ["Framework"]; // List of response headers to skip during forwarding options.IgnoreResponseHeaders = ["Content-Length"];});