Skip to content

Commit 1b2b27f

Browse files
committed
🩹 Fix: ErrorHandler incorrect selection due map iteration
1 parent 54fa41d commit 1b2b27f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,9 @@ func (app *App) ErrorHandler(ctx *Ctx, err error) error {
10411041
mountedPrefixParts int
10421042
)
10431043

1044-
for prefix, subApp := range app.mountFields.appList {
1045-
if prefix != "" && strings.HasPrefix(ctx.path, prefix) {
1044+
for _, prefix := range app.mountFields.appListKeys {
1045+
subApp := app.mountFields.appList[prefix]
1046+
if prefix != "" && strings.HasPrefix(ctx.Path(), prefix) {
10461047
parts := len(strings.Split(prefix, "/"))
10471048
if mountedPrefixParts <= parts {
10481049
if subApp.configured.ErrorHandler != nil {

0 commit comments

Comments
 (0)