imp:setup: use HEAD instead of GET to check current version

This commit is contained in:
Simon Michael 2025-04-17 17:36:20 -10:00
parent 98da9709fc
commit d408f00b42

View File

@ -249,7 +249,7 @@ setupTags = do
getLatestHledgerVersion :: IO (Either String String)
getLatestHledgerVersion = do
result <- try $ runReq defaultHttpConfig{httpConfigRedirectCount=0} $
req GET (https "hackage.haskell.org" /: "package" /: "hledger" /: "docs" /: "") NoReqBody bsResponse mempty
req HEAD (https "hackage.haskell.org" /: "package" /: "hledger" /: "docs" /: "") NoReqBody bsResponse mempty
case result of
Right _ -> return $ Left "no redirect"
Left (VanillaHttpException (HttpExceptionRequest _ (StatusCodeException rsp _))) -> do