Added Test and Docu

This commit is contained in:
Julian Beittel 2025-04-23 09:41:18 +02:00
parent e519f9f94c
commit 1e92364c13
5 changed files with 19 additions and 57 deletions

View file

@ -180,7 +180,7 @@ def json_to_nginx(robot_json):
def json_to_caddy(robot_json):
caddyfile = "@aibots {\n "
caddyfile += "\n ".join(f'header User-Agent "*{k}*"' for k in robot_json.keys())
caddyfile += f' header_regexp User-Agent "{list_to_pcre(robot_json.keys())}"'
caddyfile += "\n}"
return caddyfile