node-redis-rate-limiter
Advanced tools
Comparing version
@@ -11,3 +11,3 @@ var rateLimiter = require('./rate-limiter'); | ||
if (rate.current > rate.limit) { | ||
res.writeHead(429); | ||
res.writeHead(opts.status); | ||
res.end(); | ||
@@ -14,0 +14,0 @@ } else { |
@@ -52,4 +52,4 @@ var assert = require('assert'); | ||
assert.notEqual(getWindow(opts), 0, 'Invalid rate window: ' + getRate(opts)); | ||
assert.equal(typeof getSTatus(opts), 'number', 'Invalid status response code: ' + getStatus(opts)); | ||
assert.equal(getSTatus(opts), 'number', 'Invalid status response code: ' + getStatus(opts)); | ||
assert.equal(typeof getStatus(opts), 'number', 'Invalid status response code: ' + getStatus(opts)); | ||
assert.equal(getStatus(opts), 'number', 'Invalid status response type: ' + getStatus(opts)); | ||
var validStatuses = new Set([200,429]); | ||
@@ -56,0 +56,0 @@ assert.ok(validStatuses.has(getStatus(opts)), |
{ | ||
"name": "node-redis-rate-limiter", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Rate-limit any operation, backed by Redis", | ||
@@ -5,0 +5,0 @@ "author": "Scratch Foundation", |
9632
0.08%