From 2e7f37215c912bf0448fd8a45973683a37a4f96b Mon Sep 17 00:00:00 2001 From: Jason Cameron Date: Sat, 26 Jul 2025 20:49:54 -0400 Subject: [PATCH] fix: remove unused blocks --- cmd/robots2policy/main.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/cmd/robots2policy/main.go b/cmd/robots2policy/main.go index 9bd2c9c..a0224d4 100644 --- a/cmd/robots2policy/main.go +++ b/cmd/robots2policy/main.go @@ -29,7 +29,7 @@ var ( ) type RobotsRule struct { - UserAgents []string + UserAgents []string Disallows []string Allows []string CrawlDelay int @@ -333,15 +333,6 @@ func convertToAnubisRules(robotsRules []RobotsRule) []AnubisRule { } else if len(userAgents) == 1 { conditions = append(conditions, fmt.Sprintf("userAgent.contains(%q)", userAgents[0])) } else { - // Multiple user agents - use any block for user agents - var uaExpressions []string - for _, ua := range userAgents { - if ua == "*" { - uaExpressions = append(uaExpressions, "true") - } else { - uaExpressions = append(uaExpressions, fmt.Sprintf("userAgent.contains(%q)", ua)) - } - } // For multiple user agents, we need to use a more complex expression // This is a limitation - we can't easily combine any for user agents with all for path // So we'll create separate rules for each user agent