tests config value HttpPublicUrlBase before being used

This commit is contained in:
Madpeter 2020-05-07 07:08:55 +01:00
parent 4f7132b3b3
commit e3a528f651

View file

@ -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<string> http_args = test.Split('/', StringSplitOptions.RemoveEmptyEntries).ToList();
byte[] data;
resp.StatusCode = 200;