Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

connection: ensure constructor always returns a new instance

  • Loading branch information...
commit 4e0b0760bd6bedc868f6161599be9be826b7bdf0 1 parent daf75a9
@mscdex authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/connection.js
View
2  lib/connection.js
@@ -54,6 +54,8 @@ var /*TYPE = {
bytesNOOP = new Buffer('NOOP\r\n');
var FTP = module.exports = function() {
+ if (!(this instanceof FTP))
+ return new FTP();
this._socket = undefined;
this._pasvSock = undefined;
this._feat = undefined;
Please sign in to comment.
Something went wrong with that request. Please try again.