Skip to content
Browse files

[fix] exit out gracefully if no x-powered-by header exists

  • Loading branch information...
1 parent 4912f53 commit d814014a064ed127fa6b244a1fc984564eb0b529 @bmeck bmeck committed Aug 10, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/jitsu/api/client.js
View
2 lib/jitsu/api/client.js
@@ -68,7 +68,7 @@ Client.prototype.request = function (method, uri /* variable arguments */) {
}
var poweredBy = response.headers['x-powered-by'];
- if (poweredBy.indexOf('Nodejitsu') === -1) {
+ if (!poweredBy || 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 d814014

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