Move to some newly added upstream functions

This commit is contained in:
Michael Snoyman 2014-11-19 09:36:16 +02:00
parent 8e610e35ae
commit 01b86d368c
2 changed files with 1 additions and 21 deletions

View File

@ -13,28 +13,8 @@ getStackageIndexR ident = do
setEtag $ toPathPiece ident
addHeader "content-disposition" "attachment; filename=\"00-index.tar.gz\""
neverExpires
cacheSeconds 31536000
respondSource "application/x-gzip" $ mapOutput (Chunk . toBuilder) src
-- FIXME BEGIN: move into yesod-core
-- | Send a 304 not modified response immediately. This is a short-circuiting
-- action.
notModified :: MonadHandler m => m a
notModified = sendWaiResponse $ responseBuilder status304 [] mempty
-- | Check the if-none-match header and, if it matches the given value, return
-- a 304 not modified response. Otherwise, set the etag header to the given
-- value.
setEtag :: MonadHandler m => Text -> m ()
setEtag etag = do
mmatch <- lookupHeader "if-none-match"
case mmatch of
Just x | encodeUtf8 etag == x -> notModified
_ -> addHeader "etag" etag
-- FIXME END: move into yesod-core
getStackageBundleR :: PackageSetIdent -> Handler TypedContent
getStackageBundleR ident = do
msrc <- storeRead $ SnapshotBundle ident

View File

@ -5,7 +5,7 @@ Server for stable, curated Haskell package sets
Code builds with the Stackage snapshot:
remote-repo: stackage-e36ddac9333f2197ada6883b52f4834ddc0d5e37:http://www.stackage.org/stackage/e36ddac9333f2197ada6883b52f4834ddc0d5e37
remote-repo: stackage-35ecbe20461b5fe50bad1e5653f6660132861fe9:http://www.stackage.org/stackage/35ecbe20461b5fe50bad1e5653f6660132861fe9
Inside the config directory, there are two files ending in `-sample`. They
should be copied to remove the `-sample` suffix for the site to work. We do it