Im in?
This commit is contained in:
		
							parent
							
								
									bacb791ba9
								
							
						
					
					
						commit
						55486aaedd
					
				| @ -4,10 +4,19 @@ using Microsoft.AspNetCore.Authentication.Cookies; | |||||||
| using Microsoft.AspNetCore.Authentication.OpenIdConnect; | using Microsoft.AspNetCore.Authentication.OpenIdConnect; | ||||||
| using Microsoft.AspNetCore.HttpOverrides; | using Microsoft.AspNetCore.HttpOverrides; | ||||||
| using Microsoft.Extensions.Configuration; | using Microsoft.Extensions.Configuration; | ||||||
|  | using System.Collections; | ||||||
| 
 | 
 | ||||||
| var builder = WebApplication.CreateBuilder(args); | var builder = WebApplication.CreateBuilder(args); | ||||||
| var Configuration = builder.Configuration; | var Configuration = builder.Configuration; | ||||||
| 
 | 
 | ||||||
|  | builder.Services.Configure<ForwardedHeadersOptions>(options => | ||||||
|  | { | ||||||
|  |     options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; | ||||||
|  | 
 | ||||||
|  |     options.KnownNetworks.Clear(); | ||||||
|  |     options.KnownProxies.Clear(); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| // Add services to the container. | // Add services to the container. | ||||||
| builder.Services.AddRazorPages(); | builder.Services.AddRazorPages(); | ||||||
| builder.Services.AddControllers(); | builder.Services.AddControllers(); | ||||||
| @ -31,12 +40,7 @@ builder.Services.AddAuthentication(options => { | |||||||
| 
 | 
 | ||||||
| var app = builder.Build(); | var app = builder.Build(); | ||||||
| 
 | 
 | ||||||
| app.UseForwardedHeaders(new ForwardedHeadersOptions | app.UseForwardedHeaders(); | ||||||
| { |  | ||||||
|     RequireHeaderSymmetry = false, |  | ||||||
|     ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto |  | ||||||
| }); |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| // Configure the HTTP request pipeline. | // Configure the HTTP request pipeline. | ||||||
| if (!app.Environment.IsDevelopment()) | if (!app.Environment.IsDevelopment()) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user