From 58194838fe19461e8a9e0eb7a404a43a54457386 Mon Sep 17 00:00:00 2001 From: Brian J Brennan Date: Tue, 29 May 2012 10:56:47 -0400 Subject: [PATCH] Fix port in demo mass awarder. --- controllers/demo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/demo.js b/controllers/demo.js index 1ba39da2..ebef5047 100644 --- a/controllers/demo.js +++ b/controllers/demo.js @@ -9,7 +9,7 @@ var logger = require('../lib/logging').logger; var reverse = require('../lib/router').reverse; var protocol = configuration.get('protocol') || 'http'; -var port = configuration.get('external_port') || ''; +var port = configuration.get('port') || ''; var ORIGIN = protocol + '://' + configuration.get('hostname') + (port ? ':' + port : ''); // Render the view for the demo badge issuer. @@ -25,7 +25,7 @@ exports.issuer = function (req, res) { exports.award = function (req, res) { var assertionURL = encodeURIComponent([ORIGIN + '/demo/badge.json', qs.stringify(req.body)].join('?')); var bakeURL = ORIGIN + '/baker?award=true&assertion=' + assertionURL; - + request({url: bakeURL, encoding: 'binary'}, function (err, resp, body) { res.send(Buffer(body, 'binary'), {'content-type': 'image/png'}); }); @@ -38,7 +38,7 @@ exports.massAward = function (req, res) { var salt = 'ballertime'; var hash = require('crypto').createHash('sha256').update(email + salt).digest('hex'); var recipient = 'sha256$' + hash; - + fs.readdirSync(demoBadgeDir) .map(function (f) { var imgUrl = ORIGIN + '/static/_demo/' + f;