diff --git a/src/Http/HttpServer.cs b/src/Http/HttpServer.cs index 5485c4f..1320c7f 100644 --- a/src/Http/HttpServer.cs +++ b/src/Http/HttpServer.cs @@ -7,11 +7,11 @@ // File name: HttpServer.cs // Repository: https://github.com/sisk-http/core +using System.Net; using Sisk.Core.Http.Handlers; using Sisk.Core.Http.Hosting; using Sisk.Core.Http.Streams; using Sisk.Core.Routing; -using System.Net; namespace Sisk.Core.Http { @@ -280,7 +280,6 @@ public void Start() ObjectDisposedException.ThrowIf(this._isDisposing, this); this.listeningPrefixes = new HashSet(); - var safelisteningPrefixes = new HashSet(); for (int i = 0; i < this.ServerConfiguration.ListeningHosts.Count; i++) { @@ -291,13 +290,12 @@ public void Start() { var port = listeningHost.Ports[j]; - safelisteningPrefixes.Add(port.ToString(false)); this.listeningPrefixes.Add(port.ToString(true)); } } this.httpListener.Prefixes.Clear(); - foreach (string prefix in safelisteningPrefixes) + foreach (string prefix in this.listeningPrefixes) this.httpListener.Prefixes.Add(prefix); this._isListening = true; diff --git a/src/Http/ListeningPort.cs b/src/Http/ListeningPort.cs index 3b1b542..24adeae 100644 --- a/src/Http/ListeningPort.cs +++ b/src/Http/ListeningPort.cs @@ -221,7 +221,7 @@ public string ToString(bool includePath = true) { if (includePath) { - return $"{(this.Secure ? "https" : "http")}://{this.Hostname}:{this.Port}{this.Path}"; + return $"{(this.Secure ? "https" : "http")}://{this.Hostname}:{this.Port}{this.Path.TrimEnd('/')}/"; } else {