summaryrefslogtreecommitdiff
path: root/fig-web/src/Fig/Web/Utils.hs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-11-14 20:56:47 -0500
committerLLLL Colonq <llll@colonq>2025-11-14 20:56:47 -0500
commita69da398584644daf975db58a3ff893d29d155eb (patch)
tree4bd475f3f7b58d284acc41ed99457efeea305afa /fig-web/src/Fig/Web/Utils.hs
parent48080c62a05dff885a10ac6b6d548a8ab3582a42 (diff)
Add TCG
Diffstat (limited to 'fig-web/src/Fig/Web/Utils.hs')
-rw-r--r--fig-web/src/Fig/Web/Utils.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/fig-web/src/Fig/Web/Utils.hs b/fig-web/src/Fig/Web/Utils.hs
index 72782d9..9337b12 100644
--- a/fig-web/src/Fig/Web/Utils.hs
+++ b/fig-web/src/Fig/Web/Utils.hs
@@ -10,7 +10,7 @@ module Fig.Web.Utils
, onGet, onPost, onPut, onDelete
, status
, queryParam, queryParamMaybe, formParam, formParamMaybe, pathParam
- , header
+ , header, addHeader
, respondBytes, respondText, respondJSON, respondHTMLText, respondHTML, redirect
, WebsocketHandler
, websocket
@@ -145,6 +145,9 @@ header h = Sc.header (Text.L.fromStrict h) >>= \case
Nothing -> pure Nothing
Just t -> pure . Just $ Text.L.toStrict t
+addHeader :: Text -> Text -> Sc.ActionM ()
+addHeader h v = Sc.addHeader (Text.L.fromStrict h) (Text.L.fromStrict v)
+
respondBytes :: ByteString -> Sc.ActionM ()
respondBytes = Sc.raw . BS.L.fromStrict