mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-13 15:54:35 -05:00
Optionally allow basic auth fallback for chapter page endpoint (#1757)
Requesting a chapter page while having a non basic auth mode (e.g. ui login) enabled caused the basic auth prompt. However, this is only supposed to be happen for opds
This commit is contained in:
@@ -457,6 +457,7 @@ object MangaController {
|
||||
pathParam<Int>("index"),
|
||||
queryParam<Boolean?>("updateProgress"),
|
||||
queryParam<String?>("format"),
|
||||
queryParam<Boolean?>("opds"),
|
||||
documentWith = {
|
||||
withOperation {
|
||||
summary("Get a chapter page")
|
||||
@@ -465,8 +466,13 @@ object MangaController {
|
||||
)
|
||||
}
|
||||
},
|
||||
behaviorOf = { ctx, mangaId, chapterIndex, index, updateProgress, format ->
|
||||
ctx.getAttribute(Attribute.TachideskUser).requireUserWithBasicFallback(ctx)
|
||||
behaviorOf = { ctx, mangaId, chapterIndex, index, updateProgress, format, opds ->
|
||||
if (opds == true) {
|
||||
ctx.getAttribute(Attribute.TachideskUser).requireUserWithBasicFallback(ctx)
|
||||
} else {
|
||||
ctx.getAttribute(Attribute.TachideskUser).requireUser()
|
||||
}
|
||||
|
||||
ctx.future {
|
||||
future {
|
||||
Page.getPageImage(
|
||||
|
||||
Reference in New Issue
Block a user