Browse Source

Lint

v0.7.4-release
seebees 13 years ago
committed by koichik
parent
commit
216570b5e1
  1. 14
      lib/http.js
  2. 3
      test/simple/test-http-url.parse-auth-with-header-in-request.js
  3. 3
      test/simple/test-http-url.parse-auth.js
  4. 2
      test/simple/test-http-url.parse-https.request.js
  5. 3
      test/simple/test-http-url.parse-path.js
  6. 2
      test/simple/test-http-url.parse-post.js
  7. 2
      test/simple/test-http-url.parse-search.js
  8. 2
      test/simple/test-url.js

14
lib/http.js

@ -1015,7 +1015,7 @@ function ClientRequest(options, cb) {
if (options.port && +options.port !== options.defaultPort) {
hostHeader += ':' + options.port;
}
this.setHeader("Host", hostHeader);
this.setHeader('Host', hostHeader);
}
}
@ -1032,9 +1032,11 @@ function ClientRequest(options, cb) {
}
if (Array.isArray(options.headers)) {
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n', options.headers);
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n',
options.headers);
} else if (self.getHeader('expect')) {
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n', self._renderHeaders());
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n',
self._renderHeaders());
}
if (self.socketPath) {
self._last = true;
@ -1060,9 +1062,9 @@ function ClientRequest(options, cb) {
}
}
self._deferToConnect(null, null, function () {
self._deferToConnect(null, null, function() {
self._flush();
})
});
}
util.inherits(ClientRequest, OutgoingMessage);
@ -1095,7 +1097,7 @@ function createHangUpError() {
ClientRequest.prototype.onSocket = function(socket) {
var req = this;
process.nextTick(function () {
process.nextTick(function() {
var parser = parsers.alloc();
req.socket = socket;
req.connection = socket;

3
test/simple/test-http-url.parse-auth-with-header-in-request.js

@ -22,7 +22,6 @@
var common = require('../common');
var assert = require('assert');
var http = require('http');
var https = require('https');
var url = require('url');
var testURL = url.parse('http://asdf:qwer@localhost:' + common.PORT);
@ -45,7 +44,7 @@ var server = http.createServer(function(request, response) {
server.close();
});
server.listen(common.PORT, function () {
server.listen(common.PORT, function() {
// make the request
http.request(testURL).end();
});

3
test/simple/test-http-url.parse-auth.js

@ -22,7 +22,6 @@
var common = require('../common');
var assert = require('assert');
var http = require('http');
var https = require('https');
var url = require('url');
var testURL = url.parse('http://asdf:qwer@localhost:' + common.PORT);
@ -40,7 +39,7 @@ var server = http.createServer(function(request, response) {
server.close();
});
server.listen(common.PORT, function () {
server.listen(common.PORT, function() {
// make the request
http.request(testURL).end();
});

2
test/simple/test-http-url.parse-https.request.js

@ -47,7 +47,7 @@ var server = https.createServer(httpsOptions, function(request, response) {
server.close();
});
server.listen(common.PORT, function () {
server.listen(common.PORT, function() {
// make the request
var clientRequest = https.request(testURL);
// since there is a little magic with the agent

3
test/simple/test-http-url.parse-path.js

@ -22,7 +22,6 @@
var common = require('../common');
var assert = require('assert');
var http = require('http');
var https = require('https');
var url = require('url');
var testURL = url.parse('http://localhost:' + common.PORT + '/asdf');
@ -40,7 +39,7 @@ var server = http.createServer(function(request, response) {
server.close();
});
server.listen(common.PORT, function () {
server.listen(common.PORT, function() {
// make the request
http.request(testURL).end();
});

2
test/simple/test-http-url.parse-post.js

@ -46,7 +46,7 @@ var server = http.createServer(function(request, response) {
server.close();
});
server.listen(common.PORT, function () {
server.listen(common.PORT, function() {
// make the request
http.request(testURL).end();
});

2
test/simple/test-http-url.parse-search.js

@ -40,7 +40,7 @@ var server = http.createServer(function(request, response) {
server.close();
});
server.listen(common.PORT, function () {
server.listen(common.PORT, function() {
// make the request
http.request(testURL).end();
});

2
test/simple/test-url.js

@ -989,7 +989,7 @@ relativeTests.forEach(function(relativeTest) {
if (relativeTests2[181][0] === './/g' &&
relativeTests2[181][1] === 'f:/a' &&
relativeTests2[181][2] === 'f://g') {
relativeTests2.splice(181,1);
relativeTests2.splice(181, 1);
}
relativeTests2.forEach(function(relativeTest) {
var actual = url.resolveObject(url.parse(relativeTest[1]), relativeTest[0]),

Loading…
Cancel
Save