Skip to content

Commit

Permalink
Fixes AWS.S3.putBucketReplication signature errors
Browse files Browse the repository at this point in the history
Related to issue #910
  • Loading branch information
chrisradek committed Mar 4, 2016
1 parent fb13521 commit 9d08bc4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/services/s3.js
Expand Up @@ -152,7 +152,8 @@ AWS.util.update(AWS.S3.prototype, {
putBucketLifecycle: true,
putBucketLifecycleConfiguration: true,
putBucketTagging: true,
deleteObjects: true
deleteObjects: true,
putBucketReplication: true
},

/**
Expand Down
1 change: 1 addition & 0 deletions lib/signers/s3.js
Expand Up @@ -20,6 +20,7 @@ AWS.Signers.S3 = inherit(AWS.Signers.RequestSigner, {
'partNumber': 1,
'policy': 1,
'requestPayment': 1,
'replication': 1,
'restore': 1,
'tagging': 1,
'torrent': 1,
Expand Down
2 changes: 2 additions & 0 deletions test/services/s3.spec.coffee
Expand Up @@ -612,13 +612,15 @@ describe 'AWS.S3', ->
willCompute 'putBucketLifecycle', computeChecksums: true
willCompute 'putBucketLifecycleConfiguration', computeChecksums: true
willCompute 'putBucketTagging', computeChecksums: true
willCompute 'putBucketReplication', computeChecksums: true

it 'computes checksums if computeChecksums is off and operation requires it', ->
willCompute 'deleteObjects', computeChecksums: false
willCompute 'putBucketCors', computeChecksums: false
willCompute 'putBucketLifecycle', computeChecksums: false
willCompute 'putBucketLifecycleConfiguration', computeChecksums: false
willCompute 'putBucketTagging', computeChecksums: false
willCompute 'putBucketReplication', computeChecksums: false

it 'does not compute checksums if computeChecksums is off', ->
willCompute 'putObject', computeChecksums: false, hash: null
Expand Down
11 changes: 11 additions & 0 deletions test/signers/s3.spec.coffee
Expand Up @@ -276,6 +276,17 @@ describe 'AWS.Signers.S3', ->
/?versionId=a%2Bb
""")

it 'includes the replication subresource without a value', ->
path = '/?replication'
expect(stringToSign()).to.equal("""
POST
x-amz-date:DATE-STRING
/?replication
""")

it 'includes the non-encoded query string get header overrides', ->
path = '/?response-content-type=a%2Bb' # a+b
expect(stringToSign()).to.equal("""
Expand Down

0 comments on commit 9d08bc4

Please sign in to comment.