diff options
Diffstat (limited to 'Biz/Que/Host.hs')
-rw-r--r-- | Biz/Que/Host.hs | 10 |
1 files changed, 6 insertions, 4 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 |