Skip to content

Commit

Permalink
Autodetect a correct mime-type when deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
pazdera committed Sep 21, 2017
1 parent 8082a00 commit ba5fb1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/deploy-methods/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const aws = require('aws-sdk'),
TarGz = require('tar.gz'),
stream = require('stream'),
config = require('../config'),
Release = require('../data').Release;
Release = require('../data').Release,
mime = require('mime-types');


function _doRelease(build, target) {
Expand Down Expand Up @@ -37,7 +38,8 @@ function _doRelease(build, target) {
Key: entry.path,
Body: p,
ACL: 'public-read',
CacheControl: 'max-age=600'
CacheControl: 'max-age=600',
ContentType: mime.lookup(entry.path) || 'application/octet-stream'
},
(err, data) => {
if (err) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"colors": "^1.1.2",
"git-rev-sync": "^1.9.1",
"inquirer": "^3.2.3",
"mime-types": "^2.1.17",
"semver": "^5.4.1",
"tar.gz": "^1.0.5",
"yargs": "^8.0.2"
Expand Down

0 comments on commit ba5fb1f

Please sign in to comment.