Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:nodejitsu/jitsu

  • Loading branch information...
commit bc9e08f436d8509c8d8d7122270789fd375b5641 2 parents 81cf0dd + 69e0770
@bmeck bmeck authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/jitsu/api/client.js
View
10 lib/jitsu/api/client.js
@@ -66,7 +66,14 @@ Client.prototype.request = function (method, uri /* variable arguments */) {
catch (ex) {
// Ignore Errors
}
-
+
+ if (response.headers['x-powered-by'] !== 'Nodejitsu') {
+ error = new Error('Jitsu requires you to connect to Nodejitsu\'s stack (api.nodejitsu.com)');
+ error.statusCode = "403";
+ error.result = "";
+ return callback(error);
+ }
+
if (Object.keys(jitsu.failCodes).indexOf(statusCode) !== -1) {
error = new Error('Nodejitsu Error (' + statusCode + '): ' + jitsu.failCodes[statusCode]);
error.statusCode = statusCode;
@@ -122,7 +129,6 @@ Client.prototype.upload = function (uri, contentType, file, callback, success) {
catch (ex) {
// Ignore Errors
}
-
if (Object.keys(jitsu.failCodes).indexOf(statusCode) !== -1) {
error = new Error('Nodejitsu Error (' + statusCode + '): ' + jitsu.failCodes[statusCode]);
error.result = result;
Please sign in to comment.
Something went wrong with that request. Please try again.