set Content Type of the uploaded snapshot.json file to proper 'application/json'

This commit is contained in:
Alexey Kuleshevich 2016-10-05 18:59:26 +03:00
parent 67baaef082
commit b9965e328d

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