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 <IP>:<PORT> does not fallback to 0.0.0.0:PORT,
which would fail.

Tested: Manually
This commit is contained in:
Philipp Klocke 2023-10-15 23:19:26 +02:00 committed by Simon Michael
parent edeb906922
commit 6312446cbf

View File

@ -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"