From a5b2172cee29006d3e0d35b6e0869cfb24ace777 Mon Sep 17 00:00:00 2001 From: tom zhou Date: Mon, 30 Mar 2015 09:14:34 +0800 Subject: [PATCH] fixed peer-vnc bin --- index.js | 5 +++-- novnc.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index fe24ab6..7650b1e 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,7 @@ var Debug = 0; // - options.secmode: ssl, enable ssl/https; acl, enable ssl/https,host-based ACL // - options.sslmode: srv, only verify server side cert; both, verify both server and client side cert // - options.auth: http basic-auth as username:password +// - options.upload: file upload directory var Proxy = module.exports = function(vncs, fn, options){ var self = this; @@ -47,8 +48,8 @@ var Proxy = module.exports = function(vncs, fn, options){ } // check upload - var fileupload = false; - + var fileupload = (options && options.upload) || false; + // 1. // proxy URLs self.proxyURL = {}; // vURL for VNC server diff --git a/novnc.js b/novnc.js index 1a710b4..809acb8 100644 --- a/novnc.js +++ b/novnc.js @@ -62,7 +62,7 @@ var webServer = module.exports.webServer = function(options) { Fs.rename(req.files.file.path, newpath, function(err) { if (err) { res.writeHeader(501); - res.end('upload failed'); + res.end('upload rename failed'); } else { res.writeHeader(200, {'content-type': 'application/json'}); req.files.file.newname = newname;