chore: gofix (#1466)

Signed-off-by: Jason Cameron <jason.cameron@stanwith.me>
This commit is contained in:
Jason Cameron
2026-03-18 10:17:28 -04:00
committed by GitHub
parent c6d968874d
commit 5186d7d3ad
22 changed files with 59 additions and 78 deletions

View File

@@ -10,6 +10,7 @@ import (
"net/http"
"os"
"regexp"
"slices"
"strings"
"github.com/TecharoHQ/anubis/lib/config"
@@ -210,11 +211,8 @@ func parseRobotsTxt(input io.Reader) ([]RobotsRule, error) {
// Mark blacklisted user agents (those with "Disallow: /")
for i := range rules {
for _, disallow := range rules[i].Disallows {
if disallow == "/" {
rules[i].IsBlacklist = true
break
}
if slices.Contains(rules[i].Disallows, "/") {
rules[i].IsBlacklist = true
}
}