bugfix configure 不能DI

This commit is contained in:
2021-02-26 10:31:47 +08:00
parent 00910838fe
commit 7c3ce74a3b

View File

@@ -92,7 +92,7 @@ namespace QRCodeService
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ServiceOption option) public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{ {
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
@@ -100,11 +100,7 @@ namespace QRCodeService
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "QRCodeService v1")); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "QRCodeService v1"));
} }
if (option.IsForwarded) app.UseForwardedHeaders();
{
app.UseForwardedHeaders();
}
app.UseRouting(); app.UseRouting();
app.UseAuthorization(); app.UseAuthorization();