Browse files

[fix] more foolproof check of x-powered-by if multiple headers exist

  • Loading branch information...
1 parent 30b329c commit 4912f53f339b795d94a601dfc52763d655f4ca31 @bmeck bmeck committed Aug 10, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/jitsu/api/client.js
View
3 lib/jitsu/api/client.js
@@ -67,7 +67,8 @@ Client.prototype.request = function (method, uri /* variable arguments */) {
// Ignore Errors
}
- if (response.headers['x-powered-by'] !== 'Nodejitsu') {
+ var poweredBy = response.headers['x-powered-by'];
+ if (poweredBy.indexOf('Nodejitsu') === -1) {
error = new Error('Jitsu requires you to connect to Nodejitsu\'s stack (api.nodejitsu.com)');
error.statusCode = "403";
error.result = "";

0 comments on commit 4912f53

Please sign in to comment.