mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-17 05:44:57 +00:00
fix: add validation for generated Anubis rules from robots.txt
This commit is contained in:
@@ -85,6 +85,11 @@ func main() {
|
|||||||
// Convert to Anubis rules
|
// Convert to Anubis rules
|
||||||
anubisRules := convertToAnubisRules(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
|
// Generate output
|
||||||
var output []byte
|
var output []byte
|
||||||
switch strings.ToLower(*outputFormat) {
|
switch strings.ToLower(*outputFormat) {
|
||||||
|
|||||||
Reference in New Issue
Block a user