On Saturday, May 12, 2012 4:11:30 AM UTC+3, mscdex wrote:
>
> On May 11, 8:45 pm, Alex Netkachov <[email protected]> wrote: 
> >                 'Content-length' : data.length, 
>
> Just out of curiousity, instead of `data.length` here, try 
> `Buffer.byteLength(data)` and see how that goes.


The same. I've created a small script that dumps the request:

var http = require('http'), fs = require('fs');
http.createServer(function (req, res) {
    var stream = fs.createWriteStream('requests.log', {flags: 'a', 
encoding: 'utf8'});
    stream.write('Request info:\n');
    stream.write('    URL: ' + req.url + '\n');
    stream.write('    Method: ' + req.method + '\n');
    stream.write('    Headers:\n');
    Object.keys(req.headers).forEach(function (header) {
        stream.write('        ' + header + ': ' + this[header] + '\n');
    }, req.headers);
    req.on('data', function (chunk) {
        stream.write('    Data: ' + chunk + '\n');
    });
    req.on('end', function () {
        stream.end();
    });

    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('okay');
}).listen(33791, '127.0.0.1');

and it dumps almost the same for both requests:

Request info:
    URL: /session
    Method: POST
    Headers:
        content-length: 28
        accept: */*
        content-type: application/x-www-form-urlencoded
        host: 127.0.0.1:33791
        connection: keep-alive
    Data: { "desiredCapabilities": {}}
Request info:
    URL: /session
    Method: POST
    Headers:
        user-agent: Wget/1.11.4
        accept: */*
        host: 127.0.0.1:33791
        connection: Keep-Alive
        content-type: application/x-www-form-urlencoded
        content-length: 28
    Data: { "desiredCapabilities": {}}

content-length is the same. I've added User-agent so they become identical 
- no success.

Thanks,

Alex

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to