fix(directory): 🐛 coerce swagger server to https scheme in release mode

This commit is contained in:
Collin M. Barrett 2020-09-08 07:30:33 -05:00
parent 36e3eb9739
commit 1cdaebf9c9

View file

@ -38,7 +38,11 @@ public static void UseSwagger(this IApplicationBuilder app)
o.RouteTemplate = "{documentName}/swagger.json";
o.PreSerializeFilters.Add((swaggerDoc, httpReq) => swaggerDoc.Servers = new List<OpenApiServer>
{
#if DEBUG
new OpenApiServer {Url = $"{httpReq.Scheme}://{httpReq.Host.Value}/api"}
#else
new OpenApiServer {Url = $"https://{httpReq.Host.Value}/api"}
#endif
});
});
app.UseSwaggerUI(c =>