Skip to content

Commit cae6880

Browse files
committed
migrate opensearch.xml redirect to axum
1 parent 1dce02e commit cae6880

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/web/routes.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ pub(super) fn build_axum_routes() -> AxumRouter {
4949
"/favicon.ico",
5050
get_static(|| async { Redirect::permanent("/-/static/favicon.ico") }),
5151
)
52+
.route(
53+
"/opensearch.xml",
54+
get_static(|| async { Redirect::permanent("/-/static/opensearch.xml") }),
55+
)
5256
.route(
5357
"/sitemap.xml",
5458
get_internal(super::sitemap::sitemapindex_handler),
@@ -116,13 +120,6 @@ pub(super) fn build_axum_routes() -> AxumRouter {
116120
pub(super) fn build_routes() -> Routes {
117121
let mut routes = Routes::new();
118122

119-
// This should not need to be served from the root as we reference the inner path in links,
120-
// but clients might have cached the url and need to update it.
121-
routes.static_resource(
122-
"/opensearch.xml",
123-
PermanentRedirect("/-/static/opensearch.xml"),
124-
);
125-
126123
routes.static_resource("/-/static/:single", super::statics::static_handler);
127124
routes.static_resource("/-/static/*", super::statics::static_handler);
128125
routes.internal_page(

0 commit comments

Comments
 (0)