title: JavaScript aws-sdk S3 deleteObject(s) succedes but doesn't actually delete anything
body: <p>In the MEAN.js app I'm building I upload images to AWS S3. I am trying to use the AWS SDK to delete unwanted images from the site but after a successful ajax call the file remains on S3.</p>
  
  <p>I have required the AWS SDK like so, it works both with and without the config variables (as it should):</p>
  
  <pre><code>var aws = require('aws-sdk');
  aws.config.update({accessKeyId: process.env.AWS_ACCESS_KEY_ID, secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY});
  </code></pre>
  
  <p>For my route I have the following code: </p>
  
  <pre><code>router.post('/delete', auth, function(req,res, next){
  if(req.body.key) {
      var s3 = new aws.S3();
      var params = {
          Bucket: 'bucket name',
          Key: req.body.key
      };
      s3.deleteObject(params, function (err, data) {
          if (err) {
              console.log(err, err.stack);
              return next(err);
          }
          console.log(data);
          res.end('done');
  </code></pre>
  
  <p>I get a 200 response and <code>{}</code> is logged to the console but the file is not deleted from storage. I've also tried using the <code>deleteObjects</code> method like so: </p>
  
  <pre><code>var params = {
          Bucket: 'bucket name',
          Delete: {
              Objects: [
                  {
                      Key: req.body.key
                  }
              ]
          }
  
      };
      s3.deleteObjects(params, function (err, data) {
          if (err) {
              console.log(err, err.stack);
              return next(err);
          }
          console.log(data);
          res.end('done');
  </code></pre>
  
  <p>When I use deleteObjects I get <code>{ Deleted: [ { Key: 'file name' } ], Errors: [] }</code> as a response but the file is still on S3. </p>
  
  <p>Am I doing something wrong? I thought I followed the documentation to a T.</p>
  
  <p>Also, issue occurs wether or not versioning is enabled on the bucket. With versioning enabled my response is: </p>
  
  <pre><code>{ Deleted: 
  [ { Key: 'file name',
     DeleteMarker: true,
     DeleteMarkerVersionId: 'long id' } ],
  Errors: [] }
  </code></pre>