You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.
I'm running the following code on the official RC2 in an Azure WebApp.
usingSystem;usingMicrosoft.AspNetCore.Builder;usingMicrosoft.AspNetCore.Hosting;usingMicrosoft.AspNetCore.HttpOverrides;usingMicrosoft.Extensions.Configuration;usingMicrosoft.Extensions.DependencyInjection;usingMicrosoft.AspNetCore.Http;namespaceWebApplication2{publicclassStartup{publicStartup(IHostingEnvironmentenv){varbuilder=newConfigurationBuilder().SetBasePath(env.ContentRootPath).AddJsonFile("appsettings.json",optional:true,reloadOnChange:true).AddJsonFile($"appsettings.{env.EnvironmentName}.json",optional:true).AddEnvironmentVariables();Configuration=builder.Build();}publicIConfigurationRootConfiguration{get;}// This method gets called by the runtime. Use this method to add services to the container.publicvoidConfigureServices(IServiceCollectionservices){}// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.publicvoidConfigure(IApplicationBuilderapp){app.UseForwardedHeaders(newForwardedHeadersOptions{ForwardedHeaders=ForwardedHeaders.All});app.UseHttpMethodOverride();app.Use(async(context,next)=>{foreach(varheaderincontext.Request.Headers){if(header.Key.StartsWith("x-f",StringComparison.OrdinalIgnoreCase))awaitcontext.Response.WriteAsync($"{header.Key}: {header.Value}\r\n");}awaitcontext.Response.WriteAsync($"Method: {context.Request.Method}\r\n");awaitcontext.Response.WriteAsync($"Scheme: {context.Request.Scheme}\r\n");awaitcontext.Response.WriteAsync($"IsHttps: {context.Request.IsHttps}\r\n");awaitcontext.Response.WriteAsync("Hello World - "+DateTimeOffset.Now+Environment.NewLine);awaitcontext.Response.WriteAsync(Environment.NewLine);awaitcontext.Response.WriteAsync("Address:"+Environment.NewLine);awaitcontext.Response.WriteAsync("Host: "+context.Request.Headers["Host"]+Environment.NewLine);awaitcontext.Response.WriteAsync("PathBase: "+context.Request.PathBase.Value+Environment.NewLine);awaitcontext.Response.WriteAsync("Query: "+context.Request.QueryString.Value+Environment.NewLine);awaitcontext.Response.WriteAsync(Environment.NewLine);awaitcontext.Response.WriteAsync("Connection:"+Environment.NewLine);awaitcontext.Response.WriteAsync("RemoteIp: "+context.Connection.RemoteIpAddress+Environment.NewLine);awaitcontext.Response.WriteAsync("RemotePort: "+context.Connection.RemotePort+Environment.NewLine);awaitcontext.Response.WriteAsync("LocalIp: "+context.Connection.LocalIpAddress+Environment.NewLine);awaitcontext.Response.WriteAsync("LocalPort: "+context.Connection.LocalPort+Environment.NewLine);awaitcontext.Response.WriteAsync("ClientCert: "+context.Connection.ClientCertificate+Environment.NewLine);awaitcontext.Response.WriteAsync(Environment.NewLine);});}}}
When issueing a request over http, the following is displayed
I'm running the following code on the official RC2 in an Azure WebApp.
When issueing a request over http, the following is displayed
When issueing a request over https, the following is displayed
I must certainly be missing something obvious, but I can't see it. Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: