settings.json hash generating fix
authorDarren <darren@darrenwhitlen.com>
Sat, 10 Aug 2013 17:31:49 +0000 (18:31 +0100)
committerDarren <darren@darrenwhitlen.com>
Sat, 10 Aug 2013 17:31:49 +0000 (18:31 +0100)
server/httphandler.js

index 91bb4e6d1751c1b6358696bb3686a212c9882115..cc6902401b1ac95e0d2acf7a812b2ee4bad2f293 100644 (file)
@@ -248,7 +248,7 @@ function generateSettings(request, debug, callback) {
 
             settings = cached_settings[debug?'debug':'production'];
             settings.settings = JSON.stringify(vars);
-            settings.hash = crypto.createHash('md5').update(cached_settings.settings).digest('hex');
+            settings.hash = crypto.createHash('md5').update(settings.settings).digest('hex');
 
             return callback(null, settings);
         });
@@ -267,7 +267,7 @@ function serveSettings(request, response) {
         }
     }
 
-    settings = cached_settings[debug?'debug':'production'];
+    settings = cached_settings[debug ? 'debug' : 'production'];
     if (settings.settings === '') {
         generateSettings(request, debug, function (err, settings) {
             if (err) {