Skip to content

Commit

Permalink
As discused in #17
Browse files Browse the repository at this point in the history
  • Loading branch information
CypherPotato committed Dec 17, 2024
1 parent d47954f commit 3bbe273
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/Http/HttpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -280,7 +280,6 @@ public void Start()
ObjectDisposedException.ThrowIf(this._isDisposing, this);

this.listeningPrefixes = new HashSet<string>();
var safelisteningPrefixes = new HashSet<string>();

for (int i = 0; i < this.ServerConfiguration.ListeningHosts.Count; i++)
{
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Http/ListeningPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 3bbe273

Please sign in to comment.