davglass/nodejs-yui3 — pull request #18 by chrisklaiber (2011-11-08 22:47:58+00:00)
Title: Fix bug: config.data in GET requests is serialized into the URL twice

Serialize data into the URL once. Avoid modifying config.data and config.method within send()

Test Case
-----
Without this patch, the YUI logs show how the URL has the GET data on it twice for the following example:

info: (nodeio): URL: /?a=1&b=2&a=1&b=2

server.js

var http = require('http');
http.createServer(function (req, res) {
console.warn(req.url);
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8080, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8080/');

client.js

var YUI = require("yui3").YUI;

YUI().use('io', function(Y) {
Y.io("http://localhost:8080/", {
method: 'get',
data: {a: 1, b: 2}
});
});