Permalink
Browse files

Fix delete and 301 handler

  • Loading branch information...
1 parent 05c4546 commit de1e05925bd9fcec909d0343e1c5dce44bf5a106 @mythmon mythmon committed Aug 6, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 api.js
  2. +3 −3 utils.js
View
2 api.js
@@ -28,7 +28,7 @@ exports.status = {
user: utils.canonicalUsername(user),
api_key: CONFIG.standup.api_key
};
- return utils.request('/api/v1/status/' + id, 'DELETE', data);
+ return utils.request('/api/v1/status/' + id + '/', 'DELETE', data);
}
};
View
@@ -2,7 +2,6 @@ var _ = require('underscore');
var http = require('http');
var events = require('events');
-
/* Find a user's canonical username based on `canonicalNicks`.
*
* If no configured user can be matched, return `ircNick` unmodified.
@@ -41,7 +40,7 @@ this.isPrefix = function(a, b) {
};
-this.request = function(path, method, data, emitter) {
+function request(path, method, data, emitter) {
if (data === undefined) {
data = {};
}
@@ -73,7 +72,7 @@ this.request = function(path, method, data, emitter) {
var json = JSON.parse(resp_data);
emitter.emit('ok', json);
} else if (res.statusCode === 301) {
- this.request(res.headers.Location, method, data, emitter);
+ request(res.headers.location, method, data, emitter);
} else {
emitter.emit('error', res.statusCode, resp_data);
}
@@ -86,3 +85,4 @@ this.request = function(path, method, data, emitter) {
return emitter;
}
+this.request = request;

0 comments on commit de1e059

Please sign in to comment.