Permalink
Browse files

v0.1.3

  • Loading branch information...
1 parent a7b3b35 commit 7caa3da635eab30bae338ec4f19ca77c17cfd9e8 @SaltwaterC committed Jul 17, 2011
Showing with 11 additions and 1 deletion.
  1. +4 −0 CHANGELOG.md
  2. +6 −0 lib/ftp-get.js
  3. +1 −1 package.json
View
@@ -1,3 +1,7 @@
+## v0.1.3
+ * Trims the whitespace at the beginning and at the end of the input URL.
+ * Trims the whitespace at the beginning and at the end of the input file path.
+
## v0.1.2
* Small optimization: if the second argument is a callback, the path.resolve() call is avoided.
* Declares the socket variable into the get method.
View
@@ -23,15 +23,21 @@ var parseAuth = function (auth) {
return {};
};
+var trim = function (string) {
+ return string.replace(/^\s*/, '').replace(/\s*$/, '');
+};
+
exports.get = function (url, file, cb) {
var buffer = false;
if (typeof file == 'function') {
cb = file;
buffer = true;
} else {
+ file = trim(file);
file = p.resolve(file);
}
+ url = trim(url);
url = u.parse(url);
url.port = url.port || 21;
var auth = parseAuth(url.auth);
View
@@ -1,6 +1,6 @@
{
"name": "ftp-get",
- "version": "0.1.2",
+ "version": "0.1.3",
"main": "./lib/ftp-get.js",
"description": "Simple node.js FTP client for downloading remote files",
"engines": {

0 comments on commit 7caa3da

Please sign in to comment.