Skip to content

Commit a92b3b3

Browse files
authored
Fix npm audit warnings (#175)
* bump node * bump pug * fix test * remove forwarded * bump express deps * link to kong fork * lint fix * use @idio/dicer * formatter * bump biome * add audit * level
1 parent 9d25b99 commit a92b3b3

File tree

17 files changed

+411
-1152
lines changed

17 files changed

+411
-1152
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ jobs:
1111
- run: npm ci
1212
- uses: biomejs/setup-biome@v2
1313
- run: biome ci .
14-
- run: npm test
14+
- run: npm test
15+
- run: npm audit --audit-level=moderate

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["biomejs.biome"]
3+
}

.vscode/settings.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2-
"editor.defaultFormatter": "biomejs.biome",
3-
"editor.formatOnSave": true
2+
"editor.formatOnSave": true,
3+
"[javascript]": {
4+
"editor.defaultFormatter": "biomejs.biome"
5+
},
6+
"[json]": {
7+
"editor.defaultFormatter": "biomejs.biome"
8+
}
49
}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:21.6.2-bullseye-slim
1+
FROM node:22-bullseye-slim
22

33
RUN apt-get update && apt-get install -y --no-install-recommends dumb-init
44
ENV NODE_ENV production

lib/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ const express = require("express");
33
const mw = require("./middleware");
44
const routes = require("./routes");
55

6-
module.exports = function router(options) {
6+
module.exports = function (options) {
77
const router = express.Router();
88

99
const defaults = [
10-
mw.forwarded,
1110
mw.errorHandler,
1211
mw.bodyParser,
13-
null,
1412
mw.cors,
1513
mw.poweredBy,
1614
mw.negotiateContent,
@@ -19,14 +17,12 @@ module.exports = function router(options) {
1917
const endpoints = [
2018
{ action: "get", path: "/", route: routes.hello },
2119
{ action: "all", path: "/ip", route: routes.ips.one },
22-
{ action: "all", path: "/ips", route: routes.ips.all },
2320
{ action: "all", path: "/agent", route: routes.headers.agent },
2421
{ action: "all", path: "/status/:code/:reason?", route: routes.status },
2522
{ action: "all", path: "/headers", route: routes.headers.all },
2623
{ action: "all", path: "/header/:name", route: routes.headers.one },
2724
{ action: "all", path: "/header/:name/:value", route: routes.headers.set },
2825
{ action: "all", path: "/cookies", route: routes.cookies.all },
29-
{ action: "all", path: "/forwarded", route: routes.forwarded },
3026
{ action: "all", path: "/cookie/:name", route: routes.cookies.one },
3127
{ action: "all", path: "/cookie/:name/:value", route: routes.cookies.set },
3228
{

lib/middleware/body-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Dicer = require("dicer");
1+
const Dicer = require("@idio/dicer");
22
const querystring = require("node:querystring");
33
const contentTypeParser = require("content-type");
44
const util = require("../utils");

lib/middleware/forwarded.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/routes/bins.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ module.exports = function bins(dsnStr) {
3030
const router = express.Router();
3131

3232
const defaults = [
33-
mw.forwarded,
3433
mw.errorHandler,
3534
mw.bodyParser,
3635
null,

lib/routes/delay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function delay(req, res, next) {
1+
module.exports = function (req, res, next) {
22
let delay = req.params.ms ? Number.parseInt(req.params.ms, 10) : 200;
33

44
if (delay > 60000) {

lib/routes/forwarded.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)