From c1a6daf6d2f3b58b4cf65bc25048bad67fb2a1c4 Mon Sep 17 00:00:00 2001 From: Jason Cameron Date: Fri, 13 Jun 2025 16:56:05 -0400 Subject: [PATCH] fix: add validation for generated Anubis rules from robots.txt --- cmd/robots2policy/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/robots2policy/main.go b/cmd/robots2policy/main.go index 481c4f37..811fc156 100644 --- a/cmd/robots2policy/main.go +++ b/cmd/robots2policy/main.go @@ -85,6 +85,11 @@ func main() { // Convert to Anubis rules anubisRules := convertToAnubisRules(rules) + // Check if any rules were generated + if len(anubisRules) == 0 { + log.Fatal("no valid rules generated from robots.txt - file may be empty or contain no disallow directives") + } + // Generate output var output []byte switch strings.ToLower(*outputFormat) {