From e3a528f65194150cd8bb362a53b5020d3d86b9e3 Mon Sep 17 00:00:00 2001 From: Madpeter Date: Thu, 7 May 2020 07:08:55 +0100 Subject: [PATCH] tests config value HttpPublicUrlBase before being used --- CLI/HttpServer/SecondBotHttpServer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CLI/HttpServer/SecondBotHttpServer.cs b/CLI/HttpServer/SecondBotHttpServer.cs index f628849..dd8bbf1 100644 --- a/CLI/HttpServer/SecondBotHttpServer.cs +++ b/CLI/HttpServer/SecondBotHttpServer.cs @@ -99,7 +99,10 @@ namespace BetterSecondBot.HttpServer HttpListenerRequest req = ctx.Request; HttpListenerResponse resp = ctx.Response; string test = req.Url.AbsolutePath.Substring(1); - test = test.Replace(Config.HttpPublicUrlBase, ""); + if (helpers.notempty(Config.HttpPublicUrlBase) == true) + { + test = test.Replace(Config.HttpPublicUrlBase, ""); + } List http_args = test.Split('/', StringSplitOptions.RemoveEmptyEntries).ToList(); byte[] data; resp.StatusCode = 200;