Skip to content

Commit 117deef

Browse files
committed
migrate opensearch.xml redirect to axum
1 parent 5c4a406 commit 117deef

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),
@@ -108,13 +112,6 @@ pub(super) fn build_axum_routes() -> AxumRouter {
108112
pub(super) fn build_routes() -> Routes {
109113
let mut routes = Routes::new();
110114

111-
// This should not need to be served from the root as we reference the inner path in links,
112-
// but clients might have cached the url and need to update it.
113-
routes.static_resource(
114-
"/opensearch.xml",
115-
PermanentRedirect("/-/static/opensearch.xml"),
116-
);
117-
118115
routes.static_resource("/-/static/:single", super::statics::static_handler);
119116
routes.static_resource("/-/static/*", super::statics::static_handler);
120117
routes.internal_page(

0 commit comments

Comments
 (0)