commit a fix to have default https port on 443

已查看 70 次
跳至第一个未读帖子

tom

未读,
2012年1月31日 07:18:402012/1/31
收件人 no...@googlegroups.com
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

Eric Zhang

未读,
2012年2月1日 18:44:422012/2/1
收件人 no...@googlegroups.com
Thanks tom, I've merged this change into master.


Eric
--
Co-Founder @ Flotype, makers of NowJS
回复全部
回复作者
转发
0 个新帖子