luci-base: dispatcher.uc: satisfy auto-created intermediate nodes
authorJo-Philipp Wich <jo@mein.io>
Mon, 21 Aug 2023 07:24:32 +0000 (09:24 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 21 Aug 2023 14:40:05 +0000 (16:40 +0200)
When we auto-create intermediate parent nodes, make sure that those nodes
are marked as satisfied, so that it is possible to dispatch their actual
child nodes.

This aligns the behavior with the old Lua based dispatcher implementation.

Fixes: #6529
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ec8cf9e83cd4e4afdf0a00910e057a890600e8a8)

modules/luci-base/ucode/dispatcher.uc

index 7ff34afba9632bb3d74339a8c0d81bb1008f5d73..f42155d5396d2fc936ae5d3e05490e18bbfa8336 100644 (file)
@@ -395,7 +395,7 @@ function build_pagetree() {
                                                }
 
                                                node.children ??= {};
-                                               node.children[s[0]] ??= {};
+                                               node.children[s[0]] ??= { satisfied: true };
                                                node = node.children[s[0]];
                                        }