Skip to content

Commit

Permalink
🐛 Fix Path extractor error in v1.2 OPDS router
Browse files Browse the repository at this point in the history
Fixes #513
  • Loading branch information
aaronleopold committed Dec 8, 2024
1 parent b8b837e commit e7b7fa3
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions apps/server/src/routers/opds/v1_2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,25 @@ pub(crate) fn mount(app_state: AppState) -> Router<AppState> {
.route("/pages/:page", get(get_book_page))
.route("/file/:filename", get(download_book)),
);
Router::new()
.nest("/v1.2", primary_router.clone())
.layer(middleware::from_fn_with_state(
app_state.clone(),
auth_middleware,
))
.nest("/:api_key/v1.2", primary_router)
.layer(middleware::from_fn_with_state(
app_state,
api_key_middleware,
))

Router::new().nest(
"/v1.2",
Router::new()
.nest(
"/",
primary_router.clone().layer(middleware::from_fn_with_state(
app_state.clone(),
auth_middleware,
)),
)
.nest(
"/:api_key/v1.2",
primary_router.layer(middleware::from_fn_with_state(
app_state,
api_key_middleware,
)),
),
)
}

fn pagination_bounds(page: i64, page_size: i64) -> (i64, i64) {
Expand Down

0 comments on commit e7b7fa3

Please sign in to comment.