Closes #72
@ -48,6 +48,10 @@ function got(url, opts, cb) {
'accept-encoding': 'gzip,deflate'
}, lowercaseKeys(opts.headers));
if (opts.pathname) {
opts.path = opts.pathname;
}
if (opts.query) {
if (typeof opts.query !== 'string') {
opts.query = querystring.stringify(opts.query);
@ -48,7 +48,7 @@ test('overrides querystring from opts', function (t) {
test('pathname confusion', function (t) {
got({protocol: 'http:', hostname: s.host, port: s.port, pathname: '/test'}, function (err) {
t.ok(/http:\/\/localhost:6767\/test response code/.test(err));
t.error(err);
t.end();
});