Skip to content

Commit

Permalink
Merge pull request #173 from bradleyg/digital-ocean-support
Browse files Browse the repository at this point in the history
Cleanup.
  • Loading branch information
bradleyg authored Jan 31, 2019
2 parents bcfb1ac + 81041e9 commit 9050c5c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ npm-debug.log
.tox/
.env
.cache
settings.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "django-s3direct",
"version": "1.1.0",
"version": "1.1.1",
"description": "Add direct uploads to S3 functionality with a progress bar to file input fields.",
"directories": {
"example": "example"
Expand Down
2 changes: 1 addition & 1 deletion s3direct/static/s3direct/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@ const initiateUpload = (element, signingUrl, uploadParameters, file, dest) => {
uploadParameters.server_side_encryption,
uploadParameters.session_token
),
notSignedHeadersAtInitiate: {
'Cache-Control': uploadParameters.cache_control,
'Content-Disposition': uploadParameters.content_disposition
},
progress: (progressRatio, stats) => {
updateProgressBar(element, progressRatio);
},
Expand All @@ -193,6 +189,18 @@ const initiateUpload = (element, signingUrl, uploadParameters, file, dest) => {
}
};

const optHeaders = {}

if(uploadParameters.cache_control) {
optHeaders['Cache-Control'] = uploadParameters.cache_control
}

if(uploadParameters.content_disposition) {
optHeaders['Content-Disposition'] = uploadParameters.content_disposition
}

addConfig['notSignedHeadersAtInitiate'] = optHeaders

Evaporate
.create(createConfig)
.then(
Expand Down

0 comments on commit 9050c5c

Please sign in to comment.