add /proxy/ route
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
parent
693acb3986
commit
68c583a992
1 changed files with 11 additions and 0 deletions
11
src/lib.rs
11
src/lib.rs
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue