Makes sure routes don't overlap and yield a header set error (#2559)

This commit is contained in:
Florent Vilmart
2016-08-21 13:57:12 -04:00
committed by GitHub
parent 9ab488b6a0
commit 23e47f2e28
4 changed files with 13 additions and 9 deletions

View File

@@ -11,6 +11,9 @@ export class SessionsRouter extends ClassesRouter {
}
handleGet(req) {
if (req.params.objectId === 'me') {
return this.handleMe(req);
}
req.params.className = '_Session';
return super.handleGet(req);
}
@@ -49,7 +52,6 @@ export class SessionsRouter extends ClassesRouter {
}
mountRoutes() {
this.route('GET','/sessions/me', req => { return this.handleMe(req); });
this.route('GET', '/sessions', req => { return this.handleFind(req); });
this.route('GET', '/sessions/:objectId', req => { return this.handleGet(req); });
this.route('POST', '/sessions', req => { return this.handleCreate(req); });