Re-enable Accept-varying content for /snapshots

Fixes https://github.com/commercialhaskell/stackage-server/issues/365
This commit is contained in:
Bryan Richter 2026-04-13 09:01:58 +03:00
parent e84c1a82be
commit 51c2939880
No known key found for this signature in database
GPG Key ID: B202264020068BFB

View File

@ -72,13 +72,19 @@ fetchSnapshots = do
groupUp now' = groupBy (on (==) (.prettyDate))
. map (uncrapify now')
getAllSnapshotsR :: Handler Html
getAllSnapshotsR :: Handler TypedContent
getAllSnapshotsR = track "Handler.Snapshots.getAllSnapshotsR" $ do
(groups, Paging _ currentPage isFirstPage isLastPage) <- fetchSnapshots
defaultLayout $ do
setTitle "Stackage Server"
let snapshotsNav = $(widgetFile "snapshots-nav")
$(widgetFile "all-snapshots")
(groups, paging) <- fetchSnapshots
selectRep $ do
let Paging _ currentPage isFirstPage isLastPage = paging
provideRep $ defaultLayout $ do
setTitle "Stackage Server"
let snapshotsNav = $(widgetFile "snapshots-nav")
$(widgetFile "all-snapshots")
provideRep $ pure $ object
[ "snapshots" .= groups
, "totalCount" .= paging.totalCount
]
getApiV1SnapshotsR :: Handler Value
getApiV1SnapshotsR = track "Handler.API.getApiV1SnapshotsR" $ do