Browse Source
Only add ports with http and https protocol to ASPNETCORE_URLS (#1153)
pull/1192/head
Tim Potze
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
2 deletions
-
src/Microsoft.Tye.Hosting/DockerRunner.cs
-
src/Microsoft.Tye.Hosting/ProcessRunner.cs
|
|
|
@ -242,7 +242,8 @@ namespace Microsoft.Tye.Hosting |
|
|
|
if (docker.IsAspNet) |
|
|
|
{ |
|
|
|
// 2. Configure ASP.NET Core to bind to those same ports
|
|
|
|
environment["ASPNETCORE_URLS"] = string.Join(";", ports.Select(p => $"{p.Protocol ?? "http"}://*:{p.ContainerPort ?? p.Port}")); |
|
|
|
var urlPorts = ports.Where(p => p.Protocol == null || p.Protocol == "http" || p.Protocol == "https"); |
|
|
|
environment["ASPNETCORE_URLS"] = string.Join(";", urlPorts.Select(p => $"{p.Protocol ?? "http"}://*:{p.ContainerPort ?? p.Port}")); |
|
|
|
|
|
|
|
// Set the HTTPS port for the redirect middleware
|
|
|
|
foreach (var p in ports) |
|
|
|
|
|
|
|
@ -220,7 +220,8 @@ namespace Microsoft.Tye.Hosting |
|
|
|
// These are the ports that the application should use for binding
|
|
|
|
|
|
|
|
// 1. Configure ASP.NET Core to bind to those same ports
|
|
|
|
environment["ASPNETCORE_URLS"] = string.Join(";", ports.Select(p => $"{p.Protocol ?? "http"}://{application.ContainerEngine.AspNetUrlsHost}:{p.Port}")); |
|
|
|
var urlPorts = ports.Where(p => p.Protocol == null || p.Protocol == "http" || p.Protocol == "https"); |
|
|
|
environment["ASPNETCORE_URLS"] = string.Join(";", urlPorts.Select(p => $"{p.Protocol ?? "http"}://{application.ContainerEngine.AspNetUrlsHost}:{p.Port}")); |
|
|
|
|
|
|
|
// Set the HTTPS port for the redirect middleware
|
|
|
|
foreach (var p in ports) |
|
|
|
|