Skip to content

Commit

Permalink
more sensible default port for https
Browse files Browse the repository at this point in the history
  • Loading branch information
ericz committed Feb 1, 2012
1 parent 3164a7a commit d7593c3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/fileServer.js
Expand Up @@ -32,7 +32,6 @@ handleResponse = function (request, response) {
// Handle only GET requests for /nowjs/* files. Pass all other requests through
var i;
if (request.method === 'GET') {

// Detect if request involves the now.js file
if (request.url.split('?')[0] === '/nowjs/now.js') {
serveFile(__dirname + nowClient, request, response, options);
Expand Down Expand Up @@ -75,8 +74,7 @@ serveFile = function (filename, request, response, options) {
// 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) {

Expand Down

0 comments on commit d7593c3

Please sign in to comment.