summaryrefslogtreecommitdiff
path: root/Biz/Que
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-01-27 22:24:37 -0500
committerBen Sima <ben@bsima.me>2021-01-27 22:24:37 -0500
commit1c07b112aa8c721beadc0494972c18462a5946bf (patch)
tree9e15cb6c118f8d6dda35b09c481360e0e266f3f2 /Biz/Que
parent6c72ee7b29b5b69e93854fde67cbc7a53f998ed7 (diff)
Set subscription in user page, operator precedence
I'm still working on figuring out operator precedence with my custom operators. The normal precedences don't work well for writing code in a pipeline as I like, so I have to re-define the operators with my own fixity settings. This will take some fiddling to get right. The user subscription allows setting to "Free" only now. It's fine because I still need to do a design refresh on the pages I just made. One thing I noticed is that it's getting harder to make changes without breaking stuff, so I either need to make smaller incremental changes, or actually write some real tests. I'll probably write tests soon.
Diffstat (limited to 'Biz/Que')
-rw-r--r--Biz/Que/Host.hs10
-rw-r--r--Biz/Que/Site.hs10
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 =