From ccf98e9587359fcdba8317c9674b382488564f2f Mon Sep 17 00:00:00 2001
From: Ben Sima <ben@bsima.me>
Date: Sat, 18 Apr 2020 18:47:10 -0700
Subject: Allow '-' in quepaths and namespaces

---
 Que/Server.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'Que')

diff --git a/Que/Server.hs b/Que/Server.hs
index 5287c02..2b4e9f6 100644
--- a/Que/Server.hs
+++ b/Que/Server.hs
@@ -107,8 +107,8 @@ instance Envy.FromEnv Config
 routes :: Scotty.ScottyT Text App ()
 routes = do
   Scotty.middleware logStdout
-  let quepath = "^\\/([[:alnum:]_]+)\\/([[:alnum:]._/]*)$"
-  let namespace = "^\\/([[:alnum:]_]+)\\/?$" -- matches '/ns' and '/ns/' but not '/ns/path'
+  let quepath = "^\\/([[:alnum:]_-]+)\\/([[:alnum:]._/-]*)$"
+  let namespace = "^\\/([[:alnum:]_-]+)\\/?$" -- matches '/ns' and '/ns/' but not '/ns/path'
 
   -- GET /index.html
   Scotty.get (Scotty.literal "/index.html") <| Scotty.redirect "/_/index"
-- 
cgit v1.2.3