From 6312446cbf2ad9d8d9d935872eb1fc4ad95801f7 Mon Sep 17 00:00:00 2001 From: Philipp Klocke Date: Sun, 15 Oct 2023 23:19:26 +0200 Subject: [PATCH] web: Use guessAppRootOr to enable relative root if desired (fix #2099) This is useful when serving on 0.0.0.0, such that querying from any other device with : does not fallback to 0.0.0.0:PORT, which would fail. Tested: Manually --- hledger-web/Hledger/Web/Foundation.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hledger-web/Hledger/Web/Foundation.hs b/hledger-web/Hledger/Web/Foundation.hs index d8d156975..4066ed4d5 100644 --- a/hledger-web/Hledger/Web/Foundation.hs +++ b/hledger-web/Hledger/Web/Foundation.hs @@ -96,7 +96,7 @@ type Form a = Html -> MForm Handler (FormResult a, Widget) -- Please see the documentation for the Yesod typeclass. There are a number -- of settings which can be configured by overriding methods here. instance Yesod App where - approot = ApprootMaster $ appRoot . settings + approot = guessApprootOr (ApprootMaster $ appRoot . settings) makeSessionBackend _ = do hledgerdata <- getXdgDirectory XdgCache "hledger"