From 2c7ffa4d5c342faae03f8ebe651c502feafd0020 Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Tue, 7 Jun 2022 01:13:56 +0200 Subject: [PATCH] Add TLS length check --- FinalCommander.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FinalCommander.go b/FinalCommander.go index e0b86a3..63a8a08 100644 --- a/FinalCommander.go +++ b/FinalCommander.go @@ -237,7 +237,7 @@ func handleHexHash(pathElements []string, ctx httputils.RequestContext, host str } func handle(ctx httputils.RequestContext) { - if len(ctx.GetHost()) > 0 && strings.Split(ctx.GetHost(), ":")[0] != ctx.GetTLSServerName() { //Prevents rebinding / DNS stuff + if len(ctx.GetHost()) > 0 && len(ctx.GetTLSServerName()) > 0 && strings.Split(ctx.GetHost(), ":")[0] != ctx.GetTLSServerName() { //Prevents rebinding / DNS stuff ctx.SetResponseCode(http.StatusNotFound) return }