commit a fix to have default https port on 443

Showing 1-2 of 2 messages
commit a fix to have default https port on 443 tom 1/31/12 4:18 AM
when run https in default port(443), now.js could not serve file on 443. the fix below maybe helpful.

Index: node_modules/now/lib/fileServer.js
===================================================================
--- node_modules/now/lib/fileServer.js    (revision 889)
+++ node_modules/now/lib/fileServer.js    (working copy)
@@ -75,7 +75,7 @@
         // Determine hostname / port if not given in options
         var host = request.headers.host.split(':');
         var hostServer = options['host'] || host[0];
-        var hostPort =  options['port'] || host[1] || '80';
+        var hostPort =  options['port'] || host[1] || ((request.headers.referer.split(':')[0] === 'https') ? '443' : '80');
 
         // Call generate client libs, which takes the desired host/port and executes callback with two parts of now.js as parameters
         generateClientLibs(hostServer, hostPort, function (nowText) {


Best regards
  Tom
Re: [NowJS] commit a fix to have default https port on 443 Eric Zhang 2/1/12 3:44 PM
Thanks tom, I've merged this change into master.


Eric--
Co-Founder @ Flotype, makers of NowJS