Skip to content

Commit 6e354ec

Browse files
Nemo157jyn514
authored andcommitted
Don't record sitemap as a 'static resource' for metrics
1 parent 287451d commit 6e354ec

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/web/metrics.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ mod tests {
133133
),
134134
("/releases/recent/1", "/releases/recent/:page"),
135135
("/-/static/robots.txt", "static resource"),
136-
("/sitemap.xml", "static resource"),
136+
("/sitemap.xml", "/sitemap.xml"),
137+
("/-/sitemap/a/sitemap.xml", "/-/sitemap/:letter/sitemap.xml"),
137138
("/-/static/style.css", "static resource"),
138139
("/-/static/vendored.css", "static resource"),
139140
("/rustdoc/rcc/0.0.0/rcc/index.html", "rustdoc page"),

src/web/routes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ pub(super) fn build_routes() -> Routes {
2222
// https://support.google.com/webmasters/answer/183668?hl=en
2323
routes.static_resource("/robots.txt", PermanentRedirect("/-/static/robots.txt"));
2424
routes.static_resource("/favicon.ico", PermanentRedirect("/-/static/favicon.ico"));
25-
routes.static_resource("/sitemap.xml", super::sitemap::sitemapindex_handler);
26-
routes.static_resource(
25+
routes.internal_page("/sitemap.xml", super::sitemap::sitemapindex_handler);
26+
routes.internal_page(
2727
"/-/sitemap/:letter/sitemap.xml",
2828
super::sitemap::sitemap_handler,
2929
);

0 commit comments

Comments
 (0)