diff --git a/appveyor.yml b/appveyor.yml index 7981595e44..0cad53a1f8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -86,7 +86,7 @@ build_script: $env:swaggerGen = "true" $env:ASPNETCORE_ENVIRONMENT = "Production" cd .\src\Api - dotnet swagger tofile --output ..\..\swagger.json --host api.bitwarden.com ` + dotnet swagger tofile --output ..\..\swagger.json --host https://api.bitwarden.com ` .\bin\Debug\netcoreapp3.1\Api.dll public cd ..\.. $env:ASPNETCORE_ENVIRONMENT = "" diff --git a/src/Api/Startup.cs b/src/Api/Startup.cs index 15e7879eba..868d0e500a 100644 --- a/src/Api/Startup.cs +++ b/src/Api/Startup.cs @@ -188,12 +188,10 @@ namespace Bit.Api app.UseSwagger(config => { config.RouteTemplate = "specs/{documentName}/swagger.json"; - var host = globalSettings.BaseServiceUri.Api.Replace("https://", string.Empty) - .Replace("http://", string.Empty); config.PreSerializeFilters.Add((swaggerDoc, httpReq) => swaggerDoc.Servers = new List { - new OpenApiServer { Url = $"{httpReq.Scheme}://{host}" } + new OpenApiServer { Url = globalSettings.BaseServiceUri.Api } }); }); app.UseSwaggerUI(config =>