Skip to content
Browse files

Bug fix

  • Loading branch information...
1 parent 2bf6499 commit f2fb93286623bf0f0f80754656f3c7cdc45a616b Justin Thomas committed Feb 8, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/hashcash.js
  2. +1 −1 package.json
View
4 lib/hashcash.js
@@ -11,6 +11,7 @@ var HashCash = function() {
var answer = req.headers['hashcash-answer'];
var challenge = req.headers['hashcash-challenge'];
var still_pending = req.session[challenge];
+ console.log(still_pending);
if(!answer || !challenge || !still_pending) {
var shasum = crypto.createHash('sha1');
var rand = Math.random();
@@ -30,9 +31,8 @@ var HashCash = function() {
res.header('hashcash-challenge',challenge);
res.send('Answer challenge to complete request.');
setTimeout(function() {
- console.log(req.session);
delete req.session[challenge];
- console.log(req.session);
+ req.session.save();
},4000);
} else {
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "hashcash",
- "version": "0.1.1",
+ "version": "0.1.2",
"description": "HashCash protocol for Node",
"author": ["Justin Thomas <justin.thomas1@gmail.com>"],
"main":"./lib/hashcash",

0 comments on commit f2fb932

Please sign in to comment.
Something went wrong with that request. Please try again.