Skip to content

Commit 81465ab

Browse files
rylndJackymancs4
authored andcommitted
Ensure that the random endpoint is matched
The random endpoint was not being used; the normal ID-based endpoint would always match first.
1 parent 891cbf1 commit 81465ab

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/routes/avatars.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ router.get('/list', function(req, res) {
3131
return res.set('Content-Type', 'application/json').send(response);
3232
});
3333

34-
router.get('/:size?/:id', function(req, res, next) {
35-
return combine(req.faceParts, req.params.size, function(err, stdout) {
36-
return common.sendImage(err, stdout, req, res, next);
37-
});
38-
});
39-
4034
router.get('/:size?/random', function(req, res) {
4135
var faceParts;
4236
faceParts = potato.parts(uuid.v4());
@@ -47,6 +41,12 @@ router.get('/:size?/random', function(req, res) {
4741
});
4842
});
4943

44+
router.get('/:size?/:id', function(req, res, next) {
45+
return combine(req.faceParts, req.params.size, function(err, stdout) {
46+
return common.sendImage(err, stdout, req, res, next);
47+
});
48+
});
49+
5050
router.get('/face/:eyes/:nose/:mouth/:color/:size?', function(req, res, next) {
5151
let faceParts = { color: '#' + req.params.color };
5252

0 commit comments

Comments
 (0)