FINE
continuous-integration/drone/push Build is passing Details

pull/10/head
David D'ALMEIDA 1 year ago
parent 84515d656e
commit ea245802a9

@ -188,9 +188,22 @@ public class AppBootstrap(IConfiguration configuration)
{ {
options.PreSerializeFilters.Add((swagger, httpReq) => options.PreSerializeFilters.Add((swagger, httpReq) =>
{ {
if (httpReq.Headers.ContainsKey("X-Forwarded-Host")) if (httpReq.Headers.ContainsKey("X-Forwarded-Host"))
{ {
var basePath = "containers/HeartDev-api"; string basePath;
switch (Environment.GetEnvironmentVariable("TYPE")) // httpReq.Host.Value
{
case "STUB" :
basePath = "containers/HeartDev-heart_stub";
break;
case "BDD":
basePath = "containers/HeartDev-api";
break;
default:
basePath = httpReq.Host.Value;
break;
}
var serverUrl = $"https://{httpReq.Headers["X-Forwarded-Host"]}/{basePath}"; var serverUrl = $"https://{httpReq.Headers["X-Forwarded-Host"]}/{basePath}";
swagger.Servers = new List<OpenApiServer> { new() { Url = serverUrl } }; swagger.Servers = new List<OpenApiServer> { new() { Url = serverUrl } };
} }

Loading…
Cancel
Save