Permalink
Browse files

Support for empty query arguments into the query parameter of s3.get().

  • Loading branch information...
1 parent 752eb41 commit 19ebd541dc4154ba5f82f189fbedb5964212b8ea @SaltwaterC committed Mar 23, 2012
Showing with 16 additions and 3 deletions.
  1. +3 −0 CHANGELOG.md
  2. +5 −1 lib/internals.js
  3. +1 −1 package.json
  4. +7 −1 tests/s3-get-subresource-request-parameter.js
View
@@ -1,3 +1,6 @@
+## v0.6.10
+ * Support for the arguments without values into the optional query argument of s3.get().
+
## v0.6.9
* Adds the possibility to pass HTTP options to the client loader [#26](https://github.com/SaltwaterC/aws2js/pull/26).
* If the connection is prematurely closed, if there's an XML document as response body, its parsed version is attached to the error object [#26](https://github.com/SaltwaterC/aws2js/pull/26).
View
@@ -603,7 +603,11 @@ var checkPath = function (path, callback, query) {
if ( ! tools.isEmpty(query)) {
var queryPieces = [];
for (var i in query) {
- queryPieces.push(i + '=' + query[i]);
+ if (query[i] !== null) {
+ queryPieces.push(i + '=' + query[i]);
+ } else {
+ queryPieces.push(i);
+ }
}
query = queryPieces.join('&');
if (path.indexOf('?') === -1) {
View
@@ -1,7 +1,7 @@
{
"name": "aws2js",
"main": "./lib/aws.js",
- "version": "0.6.9",
+ "version": "0.6.10",
"description": "AWS (Amazon Web Services) APIs client implementation for node.js",
"dependencies": {
"libxmljs": ">=0.5.0",
@@ -3,7 +3,8 @@ var s3 = require('../').load('s3');
var callbacks = {
query: false,
- path: false
+ path: false,
+ queryOnly: false
};
s3.setCredentials(process.env.AWS_ACCEESS_KEY_ID, process.env.AWS_SECRET_ACCESS_KEY);
@@ -26,6 +27,11 @@ s3.get('?uploads&max-uploads=1', 'xml', function (err, res) {
s3ProcessResponse(err, res);
});
+s3.get('/', {uploads: null, 'max-uploads': 1}, 'xml', function (err, res) {
+ callbacks.queryOnly = true;
+ s3ProcessResponse(err, res);
+});
+
process.on('exit', function () {
for (var i in callbacks) {
assert.ok(callbacks[i]);

0 comments on commit 19ebd54

Please sign in to comment.