From 798f8f1bf8139d97bb4b0f6dd2c9eea938942f89 Mon Sep 17 00:00:00 2001 From: Valerio Ageno <51341197+Valerioageno@users.noreply.github.com> Date: Mon, 24 Feb 2025 12:18:14 +0100 Subject: [PATCH] feat: allow custom route with `.txt` extension (#594) --- crates/tuono/src/route.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/tuono/src/route.rs b/crates/tuono/src/route.rs index fc75d3c7..40dcd176 100644 --- a/crates/tuono/src/route.rs +++ b/crates/tuono/src/route.rs @@ -70,7 +70,7 @@ impl AxumInfo { } // TODO: to be extended with common scenarios -const NO_HTML_EXTENSIONS: [&str; 1] = ["xml"]; +const NO_HTML_EXTENSIONS: [&str; 2] = ["xml", "txt"]; // TODO: Refine this function to catch // if the methods are commented. @@ -306,6 +306,7 @@ mod tests { ("/index", "out/static/index.html"), ("/documentation", "out/static/documentation/index.html"), ("/sitemap.xml", "out/static/sitemap.xml"), + ("/robot.txt", "out/static/robot.txt"), ( "/documentation/routing", "out/static/documentation/routing/index.html",