We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e71d10a commit ebc7e4dCopy full SHA for ebc7e4d
src/Http/Owin/src/OwinEnvironment.cs
@@ -472,17 +472,14 @@ public OwinEntries(HttpContext context)
472
};
473
}
474
475
- static readonly string[] PortStrings = CreatePortStrings();
476
- static string[] CreatePortStrings()
+ static string PortToString(int port) => port switch
477
{
478
- var ports = new string[65535]; // limit of ephemeral ports https://en.wikipedia.org/wiki/Ephemeral_port
479
- for (var i = 0; i < ports.Length; i++)
480
- {
481
- ports[i] = (i + 1).ToString(CultureInfo.InvariantCulture);
482
- }
483
- return ports;
484
485
- static string PortToString(int port) => PortStrings[port - 1];
+ 80 => "80",
+ 443 => "443",
+ 8080 => "8080",
+ 8081 => "8081",
+ _ => port.ToString(CultureInfo.InvariantCulture),
+ };
486
487
public int Count
488
0 commit comments