Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Flotype/now
Browse files Browse the repository at this point in the history
  • Loading branch information
sridatta committed Aug 16, 2011
2 parents adbe86c + 32316d1 commit c183f56
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/fileServer.js
Expand Up @@ -34,13 +34,17 @@ handleResponse = function (request, response) {
} else {
// Make sure default listeners are still handled
for (i in defaultListeners) {
defaultListeners[i].call(server, request, response);
if (nowUtil.hasProperty(defaultListeners, i)) {
defaultListeners[i].call(server, request, response);
}
}
}
} else {
for (i in defaultListeners) {
// Make sure default listeners are still handled
defaultListeners[i].call(server, request, response);
if (nowUtil.hasProperty(defaultListeners, i)) {
defaultListeners[i].call(server, request, response);
}
}
}
};
Expand Down Expand Up @@ -97,9 +101,11 @@ serveFile = function (filename, request, response, options) {
generateClientLibs = function (hostServer, hostPort, callback) {
fs.readFile(__dirname + '/client/now.js', function (err, data) {
var nowText = data.toString();
var initString = options.scope + '.now = nowInitialize("//'+ hostServer + ':' + hostPort + '", ' + options.client + ');\n';
var initString = options.scope + '.now = nowInitialize("' +
(options.protocol !== undefined ? options.protocol + ':' : '') +
'//' + hostServer + ':' + hostPort + '", ' + options.client + ');\n';
nowText += initString;

callback(nowText);
});
};
Expand Down

0 comments on commit c183f56

Please sign in to comment.