Skip to content

Commit

Permalink
Closed #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Malte Legenhausen committed Dec 23, 2011
1 parent b0e10dd commit 22611eb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
11 changes: 1 addition & 10 deletions lib/ogone.js
Expand Up @@ -87,7 +87,7 @@ Request.prototype._send = function(callback) {
if (prepared instanceof Error) {
return callback(prepared);
}
var body = Request.stringify(prepared);
var body = qs.stringify(prepared);
request.post({
url: this.url,
headers: {
Expand All @@ -108,15 +108,6 @@ Request.prototype._send = function(callback) {
}.bind(this));
};

//TODO: Fix for qs issue #23
Request.stringify = function(obj) {
var result = {};
Object.keys(obj).each(function(key) {
result[key] = obj[key].toString();
});
return qs.stringify(result);
};

Request.normalize = function(method, obj) {
var result = {};
Object.keys(obj).map(function(key) {
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -16,7 +16,6 @@
"dependencies": {
"xml2js": "0.x.x",
"sugar": "1.x.x",
"qs": "0.x.x",
"request": "1.x.x"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion test/ogone.js
Expand Up @@ -173,9 +173,10 @@ exports.testSendSuccess = function(test) {
var _post = request.post;
var req = new Ogone.Request();
req._prepare = function() {
return {};
return {foo: 123};
};
request.post = function(message, callback) {
test.equal(message.body, 'foo=123');
return callback(null, 'Test');
};
req.parser.parseString = function(body, callback) {
Expand Down

0 comments on commit 22611eb

Please sign in to comment.