Skip to content
This repository has been archived by the owner on Dec 21, 2018. It is now read-only.

Commit

Permalink
Fix delete and 301 handler
Browse files Browse the repository at this point in the history
  • Loading branch information
mythmon committed Aug 6, 2012
1 parent 05c4546 commit de1e059
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

Expand Down
6 changes: 3 additions & 3 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 = {};
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -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.