1 write to _options
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersMiddleware.cs (1)
62_options = options.Value;
40 references to _options
Microsoft.AspNetCore.HttpOverrides (40)
ForwardedHeadersMiddleware.cs (40)
71if (_options.AllowedHosts == null || _options.AllowedHosts.Count == 0) 78foreach (var entry in _options.AllowedHosts) 129if (_options.ForwardedHeaders.HasFlag(ForwardedHeaders.XForwardedFor)) 132forwardedFor = requestHeaders.GetCommaSeparatedValues(_options.ForwardedForHeaderName); 136if (_options.ForwardedHeaders.HasFlag(ForwardedHeaders.XForwardedProto)) 139forwardedProto = requestHeaders.GetCommaSeparatedValues(_options.ForwardedProtoHeaderName); 140if (_options.RequireHeaderSymmetry && checkFor && forwardedFor!.Length != forwardedProto.Length) 148if (_options.ForwardedHeaders.HasFlag(ForwardedHeaders.XForwardedHost)) 151forwardedHost = requestHeaders.GetCommaSeparatedValues(_options.ForwardedHostHeaderName); 152if (_options.RequireHeaderSymmetry 162if (_options.ForwardedHeaders.HasFlag(ForwardedHeaders.XForwardedPrefix)) 165forwardedPrefix = requestHeaders.GetCommaSeparatedValues(_options.ForwardedPrefixHeaderName); 166if (_options.RequireHeaderSymmetry 178if (_options.ForwardLimit.HasValue && entryCount > _options.ForwardLimit) 180entryCount = _options.ForwardLimit.Value; 216var checkKnownIps = _options.KnownNetworks.Count > 0 || _options.KnownProxies.Count > 0; 252else if (_options.RequireHeaderSymmetry) 266else if (_options.RequireHeaderSymmetry) 268_logger.LogWarning(3, $"Forwarded scheme is not present, this is required by {nameof(_options.RequireHeaderSymmetry)}"); 281else if (_options.RequireHeaderSymmetry) 283_logger.LogWarning(4, $"Incorrect number of x-forwarded-host header values, see {nameof(_options.RequireHeaderSymmetry)}."); 295else if (_options.RequireHeaderSymmetry) 297_logger.LogWarning(5, $"Incorrect number of x-forwarded-prefix header values, see {nameof(_options.RequireHeaderSymmetry)}"); 310requestHeaders[_options.OriginalForHeaderName] = new IPEndPoint(connection.RemoteIpAddress, connection.RemotePort).ToString(); 315requestHeaders[_options.ForwardedForHeaderName] = 321requestHeaders.Remove(_options.ForwardedForHeaderName); 330requestHeaders[_options.OriginalProtoHeaderName] = request.Scheme; 334requestHeaders[_options.ForwardedProtoHeaderName] = 340requestHeaders.Remove(_options.ForwardedProtoHeaderName); 348requestHeaders[_options.OriginalHostHeaderName] = request.Host.ToString(); 352requestHeaders[_options.ForwardedHostHeaderName] = 358requestHeaders.Remove(_options.ForwardedHostHeaderName); 368requestHeaders[_options.OriginalPrefixHeaderName] = request.PathBase.ToString(); 374requestHeaders[_options.ForwardedPrefixHeaderName] = 380requestHeaders.Remove(_options.ForwardedPrefixHeaderName); 398if (_options.KnownProxies.Contains(address)) 402foreach (var network in _options.KnownNetworks)