diff options
author | Profpatsch <mail@profpatsch.de> | 2024-05-11T18·42+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-05-13T14·45+0000 |
commit | d119d07aaa3b7dec8cc2e1cde61e782dfaa0d422 (patch) | |
tree | a4b6ede1eff70682e7d3b6e8773cd2de5ae752ca /users/Profpatsch | |
parent | 173e864f30b45fe72cb1a6de7ce4d6c57f105c74 (diff) |
refactor(users/Profpatsch/whatcd-resolver): inline h r/8126
Change-Id: If14bc2d72b28a3022067f42b63596a745ad891d9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11645 Autosubmit: Profpatsch <mail@profpatsch.de> Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
Diffstat (limited to 'users/Profpatsch')
-rw-r--r-- | users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs index 9aa8233f571e..ad51b2edeed1 100644 --- a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs +++ b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs @@ -323,15 +323,14 @@ runHandlers defaultHandler handlers req respond = withRunInIO $ \runInIO -> do } ) ( \span -> do - res <- act span + res <- act span <&> (\html -> T2 (label @"html" html) (label @"extraHeaders" [])) liftIO $ respond . Wai.responseLBS Http.ok200 ([("Content-Type", "text/html")] <> res.extraHeaders) . Html.renderHtml $ res.html ) - let h route act = hh route (\span -> act span <&> (\html -> T2 (label @"html" html) (label @"extraHeaders" []))) let path = [fmt|/{req & Wai.pathInfo & Text.intercalate "/"}|] let handlerResponses = ( HandlerResponses - { html = h path, + { html = hh path, plain = (\m -> liftIO $ runInIO m >>= respond) } ) |