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:
Michael Snoyman 2016-10-05 19:14:54 +03:00 committed by GitHub
commit 81df4e9b35

View File

@ -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