Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
Fix port in demo mass awarder.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianloveswords committed May 29, 2012
1 parent 824b5e8 commit 5819483
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/demo.js
Expand Up @@ -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.
Expand All @@ -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'});
});
Expand All @@ -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;
Expand Down

0 comments on commit 5819483

Please sign in to comment.