diff options
Diffstat (limited to 'Biz/Que')
-rw-r--r-- | Biz/Que/Host.hs | 10 | ||||
-rw-r--r-- | Biz/Que/Site.hs | 10 |
2 files changed, 11 insertions, 9 deletions
diff --git a/Biz/Que/Host.hs b/Biz/Que/Host.hs index d50993c..cbf4bfd 100644 --- a/Biz/Que/Host.hs +++ b/Biz/Que/Host.hs @@ -166,10 +166,12 @@ routes cfg = do authkey <- fromMaybe "" </ Scotty.header "Authorization" (ns, qp) <- extract -- Only allow my IP or localhost to publish to '_' namespace - when ("_" == ns && authkey /= (Text.Lazy.strip <| queSkey cfg)) - <| Scotty.status Http.methodNotAllowed405 - >> Scotty.text "not allowed: _ is a reserved namespace" - >> Scotty.finish + when + ("_" == ns && authkey /= (Text.Lazy.strip <| queSkey cfg)) + ( Scotty.status Http.methodNotAllowed405 + >> Scotty.text "not allowed: _ is a reserved namespace" + >> Scotty.finish + ) guardNs ns ["pub", "_"] -- passed all auth checks app <. modify <| upsertNamespace ns diff --git a/Biz/Que/Site.hs b/Biz/Que/Site.hs index c2245d6..3e456da 100644 --- a/Biz/Que/Site.hs +++ b/Biz/Que/Site.hs @@ -111,11 +111,11 @@ run key ns Sources {..} = Async.runConcurrently actions |> void actions = traverse Async.Concurrently - [ forever <| toHtml index >>= serve key ns "index", - forever <| toHtml quescripts >>= serve key ns "quescripts", - forever <| BS.readFile client >>= serve key ns "client", - forever <| toHtml tutorial >>= serve key ns "tutorial", - forever <| toHtml apidocs >>= serve key ns "apidocs" + [ toHtml index >>= serve key ns "index" |> forever, + toHtml quescripts >>= serve key ns "quescripts" |> forever, + BS.readFile client >>= serve key ns "client" |> forever, + toHtml tutorial >>= serve key ns "tutorial" |> forever, + toHtml apidocs >>= serve key ns "apidocs" |> forever ] toHtml :: FilePath -> IO ByteString toHtml md = |