Commit bff16a5316e93a512d15ea04728d57ebe84afa1a

Thomas de Grivel 2024-11-20T22:33:53

fix httpd route

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/lib/kc3/0.1/httpd/route.kc3 b/lib/kc3/0.1/httpd/route.kc3
index 1251e15..c30a733 100644
--- a/lib/kc3/0.1/httpd/route.kc3
+++ b/lib/kc3/0.1/httpd/route.kc3
@@ -6,7 +6,8 @@ defmodule HTTPd.Route do
              controller: ?]
 
   def match = fn (route, request) {
-    if (route.path == "/" ||
+    if (route.path == "" ||
+        route.path == "/" ||
         (Str.ends_with?(route.path, "/") &&
          request.url == Str.slice(route.path, 0, -2)) ||
         Str.starts_with?(request.url, route.path)) do