add /proxy/ route

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
ゆめ 2024-11-14 01:13:17 -06:00
parent 693acb3986
commit 68c583a992
No known key found for this signature in database

View file

@ -129,6 +129,17 @@ where
))
.fallback(|| async { ErrorResponse::method_not_allowed() }),
)
.route(
"/proxy/",
get(App::<C, S>::proxy_without_filename)
.head(App::<C, S>::proxy_without_filename)
.options(App::<C, S>::proxy_options)
.route_layer(middleware::from_fn_with_state(
state.clone(),
set_cache_control,
))
.fallback(|| async { ErrorResponse::method_not_allowed() }),
)
.route(
"/proxy/:filename",
get(App::<C, S>::proxy_with_filename)