Use DELETE method instead of GET for key removal
This commit is contained in:
@@ -51,6 +51,9 @@ router.post('/api/v1/key', function *() {
|
||||
router.get('/api/v1/key', function *() {
|
||||
yield rest.query(this);
|
||||
});
|
||||
router.del('/api/v1/key', function *() {
|
||||
yield rest.remove(this);
|
||||
});
|
||||
|
||||
// Redirect all http traffic to https
|
||||
app.use(function *(next) {
|
||||
|
||||
@@ -56,7 +56,7 @@ class REST {
|
||||
*/
|
||||
*query(ctx) {
|
||||
let op = ctx.query.op;
|
||||
if (this[op]) {
|
||||
if (op === 'verify' || op === 'verifyRemove') {
|
||||
return yield this[op](ctx); // delegate operation
|
||||
}
|
||||
// do READ if no 'op' provided
|
||||
|
||||
Reference in New Issue
Block a user