mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-18 23:21:55 +01:00
Merge pull request #204 from fpco/put-snapshot-mimetype
set Content Type of the snapshot.json file to 'application/json'
This commit is contained in:
commit
81df4e9b35
@ -23,7 +23,7 @@ import Network.AWS (Credentials (Discover),
|
|||||||
import Control.Monad.Trans.AWS (trying, _Error)
|
import Control.Monad.Trans.AWS (trying, _Error)
|
||||||
import Network.AWS.Data.Body (toBody)
|
import Network.AWS.Data.Body (toBody)
|
||||||
import Network.AWS.S3 (ObjectCannedACL (OPublicRead),
|
import Network.AWS.S3 (ObjectCannedACL (OPublicRead),
|
||||||
poACL, putObject,
|
poACL, poContentType, putObject,
|
||||||
BucketName(BucketName),
|
BucketName(BucketName),
|
||||||
ObjectKey(ObjectKey))
|
ObjectKey(ObjectKey))
|
||||||
import Control.Lens (set, view)
|
import Control.Lens (set, view)
|
||||||
@ -182,6 +182,7 @@ stackageServerCron = do
|
|||||||
let key = ObjectKey "snapshots.json"
|
let key = ObjectKey "snapshots.json"
|
||||||
po =
|
po =
|
||||||
set poACL (Just OPublicRead)
|
set poACL (Just OPublicRead)
|
||||||
|
$ set poContentType (Just "application/json")
|
||||||
$ putObject (BucketName "haddock.stackage.org") key (toBody snapshots)
|
$ putObject (BucketName "haddock.stackage.org") key (toBody snapshots)
|
||||||
putStrLn $ "Uploading: " ++ tshow key
|
putStrLn $ "Uploading: " ++ tshow key
|
||||||
eres <- runResourceT $ runAWS env $ trying _Error $ send po
|
eres <- runResourceT $ runAWS env $ trying _Error $ send po
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user