From 173cf37b39112d7d1089863778989e43b2aa9308 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Wed, 20 Apr 2016 13:48:14 -0400 Subject: [PATCH] lib/nitcorn: force all routes path to begin with a "/" once registered MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/nitcorn/server_config.nit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/nitcorn/server_config.nit b/lib/nitcorn/server_config.nit index c2bd614..e61caad 100644 --- a/lib/nitcorn/server_config.nit +++ b/lib/nitcorn/server_config.nit @@ -61,6 +61,12 @@ class Route # Path to this action present in the URI var path: nullable String + init + do + var path = path + if path != null then self.path = "/" / path + end + # `Action` to activate when this route is traveled var handler: Action end -- 1.7.9.5