diff --git a/.gitignore b/.gitignore
index d51c263..579d884 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
/.settings
/node_modules
*.komodoproject
+.idea
diff --git a/lib/aws.js b/lib/aws.js
index c07cd9b..aa77de8 100644
--- a/lib/aws.js
+++ b/lib/aws.js
@@ -4,6 +4,7 @@
// we aren't unescaping URLs in the first place, therefore there's no URL decoding to break
/*global unescape*/
/*jslint regexp: true*/
+/*jslint todo: true*/
// TODO: refactor
@@ -284,10 +285,19 @@ var client = function (config, httpOptions) {
query = {};
}
internals.checkConfig(config);
- path = internals.checkPath(path, callback, query);
+
+ query = lodash.clone(query);
+ var additionalHeaders = {};
+ if (query.headers) {
+ additionalHeaders = query.headers;
+ delete query.headers;
+ }
+
+ path = internals.checkPath(path, callback, query);
if ( ! path) {
return;
}
+
internals.standardHeaders(config, 'GET', {}, path, function (err, headers) {
if (err) {
callback(err);
@@ -295,7 +305,7 @@ var client = function (config, httpOptions) {
var options = lodash.clone(httpOptions);
options.method = 'GET';
options.path = path;
- options.headers = headers;
+ options.headers = tools.merge(headers, additionalHeaders);
internals.makeRequest(config, options, false, handler, callback);
}
}
@@ -792,7 +802,7 @@ var client = function (config, httpOptions) {
* @param {Function} callback
*/
config.moveObject = function (source, destination, acl, headers, callback) {
- config.copyObject(source, destination, acl, headers, function(error, response) {
+ config.copyObject(source, destination, acl, headers, function(error) {
if (error) {
callback(error);
} else {
@@ -822,7 +832,7 @@ var client = function (config, httpOptions) {
}
absSource = '/' + config.useBucket + absSource;
- config.copyObject(absSource, destination, acl, headers, function (error, response) {
+ config.copyObject(absSource, destination, acl, headers, function (error) {
if (error) {
callback(error);
} else {
@@ -1140,7 +1150,7 @@ var client = function (config, httpOptions) {
errors[partNumber]++;
if (errors[partNumber] === 10) {
aborted = true;
- config.abortUpload(path, uploadId, function (err, res) {
+ config.abortUpload(path, uploadId, function (err) {
if ( ! err) {
err = new Error('Part ' + partNumber + ' failed the upload 10 times. Aborting the multipart upload.');
err.partNumber = partNumber;
@@ -1209,10 +1219,10 @@ var client = function (config, httpOptions) {
xml += 'true';
}
- var idx;
+ var idx, object;
var count = objects.length;
for (idx = 0; idx < count; idx++) {
- var object = objects[idx];
+ object = objects[idx];
if (typeof object.key === 'string') {
xml += '