Return 404 when the dns domain has any path different than /

This commit is contained in:
2024-05-12 19:24:10 +02:00
parent b57beded8f
commit 789cc6939e
3 changed files with 16 additions and 3 deletions

View File

@ -31,7 +31,7 @@ func GetDNSDiscoveryHandler(store *cache.Cache, domain string, redirectPort stri
return
}
if ctx.Request.Host == domain {
if ctx.Request.Host == domain && ctx.Request.URL.Path == "/" {
ctx.Redirect(http.StatusFound, fmt.Sprintf("http://%s.%s%s", uuid.New().String(), domain, redirectPort))
ctx.Abort()
return