fix missing check if variant in PathInfo is legal

Thu, 11 Jun 2026 14:53:51 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 11 Jun 2026 14:53:51 +0200
changeset 426
902b305547bc
parent 425
adaf9cf8b97e
child 427
4124102c2f37

fix missing check if variant in PathInfo is legal

src/main/kotlin/de/uapcore/lightpit/viewmodel/PathInfos.kt file | annotate | diff | comparison | revisions
--- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/PathInfos.kt	Tue Jun 09 16:24:15 2026 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/PathInfos.kt	Thu Jun 11 14:53:51 2026 +0200
@@ -77,7 +77,7 @@
     val component = http.lookupPathParam("component", projectInfo.components)
     val variant = http.lookupPathParam("variant", projectInfo.variants)
 
-    if (version == OptionalPathInfo.NotFound || component == OptionalPathInfo.NotFound) {
+    if (version == OptionalPathInfo.NotFound || component == OptionalPathInfo.NotFound || variant == OptionalPathInfo.NotFound) {
         http.response.sendError(404)
         return null
     }

mercurial