mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-24 09:51:57 +01:00
Move to some newly added upstream functions
This commit is contained in:
parent
8e610e35ae
commit
01b86d368c
@ -13,28 +13,8 @@ getStackageIndexR ident = do
|
|||||||
setEtag $ toPathPiece ident
|
setEtag $ toPathPiece ident
|
||||||
addHeader "content-disposition" "attachment; filename=\"00-index.tar.gz\""
|
addHeader "content-disposition" "attachment; filename=\"00-index.tar.gz\""
|
||||||
neverExpires
|
neverExpires
|
||||||
cacheSeconds 31536000
|
|
||||||
respondSource "application/x-gzip" $ mapOutput (Chunk . toBuilder) src
|
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 :: PackageSetIdent -> Handler TypedContent
|
||||||
getStackageBundleR ident = do
|
getStackageBundleR ident = do
|
||||||
msrc <- storeRead $ SnapshotBundle ident
|
msrc <- storeRead $ SnapshotBundle ident
|
||||||
|
|||||||
@ -5,7 +5,7 @@ Server for stable, curated Haskell package sets
|
|||||||
|
|
||||||
Code builds with the Stackage snapshot:
|
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
|
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
|
should be copied to remove the `-sample` suffix for the site to work. We do it
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user