Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23ccc8d

Browse files
thimovssrngadam
authored andcommitted
readded getEntries to endpoint and fixed key undefined error.
1 parent b3f9755 commit 23ccc8d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/server/api/endpoints.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'arpTable.js';
1+
import {associateEntry, clearExpiredEntries, getEntries} from '../api/arpTable.js';
22

33
RouterApi = new Restivus({
44
apiPath: 'routerapi/',
@@ -16,7 +16,6 @@ RouterApi.addRoute(
1616
var key, arpTable, headers = request.headers;
1717
var router = _.findWhere(App.routers, { name: this.urlParams.name });
1818

19-
var key = headers.authorization.substring('Bearer '.length);
2019

2120
if (!router) {
2221
return {
@@ -38,6 +37,7 @@ RouterApi.addRoute(
3837
};
3938
}
4039

40+
var key = headers.authorization.substring('Bearer '.length);
4141

4242
if (key !== router.key) {
4343
return {
@@ -67,6 +67,8 @@ RouterApi.addRoute(
6767
}
6868
});
6969

70+
entries = getEntries(request.body.arpTable);
71+
7072
entries.forEach((entry) => {
7173
associateEntry(entry);
7274
});

0 commit comments

Comments
 (0)