Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #69 from nicoreed/master

The powered by nodejitsu header
  • Loading branch information...
commit 69e07705a3479dddc77de369163bbca7807c80b1 2 parents ad3350a + 41c9e60
@indexzero indexzero 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;

4 comments on commit 69e0770

@bmeck

This just broke Jitsu, right now nodejitsu is giving back 'haibu' for X-Powered-By

@indexzero
Owner

@bmeck. Ok, that's a pretty simple fix in haibu. I'll make it in a few min. This isn't published to npm so just use the latest there

@bmeck
@indexzero
Owner

@bmeck This is now fixed in haibu and upstream dependencies. Will push to staging this evening.

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