mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
fix(directory): 🐛 coerce swagger server to https scheme in release mode
This commit is contained in:
parent
36e3eb9739
commit
1cdaebf9c9
1 changed files with 4 additions and 0 deletions
|
|
@ -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 =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue