mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-28 21:02:04 +03:00
web: prevent an infinite redirect when custom base url has a trailing slash
This commit is contained in:
parent
85b2307e78
commit
15c39ac6c9
@ -56,9 +56,11 @@ toWebOpts rawopts = do
|
||||
let p = fromMaybe defport $ maybeintopt "port" rawopts
|
||||
return defwebopts {
|
||||
port_ = p
|
||||
,base_url_ = fromMaybe (defbaseurl p) $ maybestringopt "base-url" rawopts
|
||||
,base_url_ = maybe (defbaseurl p) stripTrailingSlash $ maybestringopt "base-url" rawopts
|
||||
,cliopts_ = cliopts
|
||||
}
|
||||
where
|
||||
stripTrailingSlash = reverse . dropWhile (=='/') . reverse -- yesod don't like it
|
||||
|
||||
checkWebOpts :: WebOpts -> IO WebOpts
|
||||
checkWebOpts opts = do
|
||||
|
Loading…
Reference in New Issue
Block a user