From 4e299a0cd1414835fa0b6ee38236453f5cd8e6e3 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Mon, 1 Aug 2022 22:41:06 -0400 Subject: [PATCH 01/34] build: Node.js@18.7 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9bfe2f..c4bb7ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: node-version: "17.9" - name: Node.js 18.x - node-version: "18.0" + node-version: "18.7" steps: - uses: actions/checkout@v2 From 58205b434b312e89166096d826bfcb8f2329f8d7 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Mon, 1 Aug 2022 22:44:48 -0400 Subject: [PATCH 02/34] build: Node.js@16.16 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4bb7ff..173f913 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,7 +103,7 @@ jobs: node-version: "15.14" - name: Node.js 16.x - node-version: "16.15" + node-version: "16.16" - name: Node.js 17.x node-version: "17.9" From ac6a7597be4f822f42ab93b4e5974851d07f67b2 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Mon, 1 Aug 2022 22:47:42 -0400 Subject: [PATCH 03/34] build: Node.js@14.20 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 173f913..e22af91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: node-version: "13.14" - name: Node.js 14.x - node-version: "14.19" + node-version: "14.20" - name: Node.js 15.x node-version: "15.14" From d7a7c4d53665257af5ba1a2358620c05d6a01b71 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Wed, 3 Aug 2022 23:01:47 -0400 Subject: [PATCH 04/34] build: supertest@6.2.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 01c6742..85f4b93 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "mocha": "9.2.2", "nyc": "15.1.0", "safe-buffer": "5.2.1", - "supertest": "6.2.3" + "supertest": "6.2.4" }, "files": [ "lib/", From 03fff1ce61b5416b9b621629ca33f26ddf298149 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 23 Sep 2022 18:27:58 -0400 Subject: [PATCH 05/34] build: eslint@8.23.1 --- .github/workflows/ci.yml | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e22af91..b6e616c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,8 +141,8 @@ jobs: shell: bash run: | # eslint for linting - # - remove on Node.js < 10 - if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then + # - remove on Node.js < 12 + if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 12 ]]; then node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \ grep -E '^eslint(-|$)' | \ sort -r | \ diff --git a/package.json b/package.json index 85f4b93..9c36dae 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "after": "0.8.2", - "eslint": "7.32.0", + "eslint": "8.23.1", "eslint-plugin-markdown": "2.2.1", "finalhandler": "1.2.0", "mocha": "9.2.2", From 9c9a2a210d7a5a1697de466ef9b4f7dd5396a099 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 23 Sep 2022 20:03:19 -0400 Subject: [PATCH 06/34] build: eslint-plugin-markdown@3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9c36dae..62f6bf6 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "devDependencies": { "after": "0.8.2", "eslint": "8.23.1", - "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-markdown": "3.0.0", "finalhandler": "1.2.0", "mocha": "9.2.2", "nyc": "15.1.0", From 2075428e130d640dffd7da9fffb14371bdcf2c6c Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 23 Sep 2022 20:10:01 -0400 Subject: [PATCH 07/34] build: mocha@10.0.0 --- .github/workflows/ci.yml | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6e616c..1afa375 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,9 +92,11 @@ jobs: - name: Node.js 12.x node-version: "12.22" + npm-i: mocha@9.2.2 - name: Node.js 13.x node-version: "13.14" + npm-i: mocha@9.2.2 - name: Node.js 14.x node-version: "14.20" diff --git a/package.json b/package.json index 62f6bf6..23a8fe7 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "eslint": "8.23.1", "eslint-plugin-markdown": "3.0.0", "finalhandler": "1.2.0", - "mocha": "9.2.2", + "mocha": "10.0.0", "nyc": "15.1.0", "safe-buffer": "5.2.1", "supertest": "6.2.4" From 91a860bbf0dd67945afb3ade7803ced9d13bd011 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 23 Sep 2022 20:10:33 -0400 Subject: [PATCH 08/34] build: Node.js@16.17 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1afa375..8d624fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,7 @@ jobs: node-version: "15.14" - name: Node.js 16.x - node-version: "16.16" + node-version: "16.17" - name: Node.js 17.x node-version: "17.9" From 0e3ddce9388ae61e639a6de9b5fa421c3591a59e Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 23 Sep 2022 20:11:57 -0400 Subject: [PATCH 09/34] Fix routing requests without method --- HISTORY.md | 5 +++++ lib/route.js | 9 +++++++-- test/route.js | 24 ++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 9e2d8be..5e42df5 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,8 @@ +unreleased +========== + + * Fix routing requests without method + 1.3.7 / 2022-04-28 ================== diff --git a/lib/route.js b/lib/route.js index c82a3cc..1918e46 100644 --- a/lib/route.js +++ b/lib/route.js @@ -61,7 +61,9 @@ Route.prototype._handles_method = function _handles_method(method) { } // normalize name - var name = method.toLowerCase() + var name = typeof method === 'string' + ? method.toLowerCase() + : method if (name === 'head' && !this.methods['head']) { name = 'get' @@ -106,7 +108,10 @@ Route.prototype.dispatch = function dispatch(req, res, done) { return done() } - var method = req.method.toLowerCase() + var method = typeof req.method === 'string' + ? req.method.toLowerCase() + : req.method + if (method === 'head' && !this.methods['head']) { method = 'get' } diff --git a/test/route.js b/test/route.js index ba00fec..6a97ec0 100644 --- a/test/route.js +++ b/test/route.js @@ -44,6 +44,30 @@ describe('Router', function () { .expect(404, cb) }) + it('should route without method', function (done) { + var router = new Router() + var route = router.route('/foo') + var server = createServer(function (req, res, next) { + req.method = undefined + router(req, res, next) + }) + + route.post(createHitHandle(1)) + route.all(createHitHandle(2)) + route.get(createHitHandle(3)) + + router.get('/foo', createHitHandle(4)) + router.use(saw) + + request(server) + .get('/foo') + .expect(shouldNotHitHandle(1)) + .expect(shouldHitHandle(2)) + .expect(shouldNotHitHandle(3)) + .expect(shouldNotHitHandle(4)) + .expect(200, 'saw undefined /foo', done) + }) + it('should stack', function (done) { var cb = after(3, done) var router = new Router() From df7ccba3722605e8b630e009e2f50f5705ad629b Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 23 Sep 2022 20:13:28 -0400 Subject: [PATCH 10/34] build: eslint@8.24.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23a8fe7..ee39c93 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "after": "0.8.2", - "eslint": "8.23.1", + "eslint": "8.24.0", "eslint-plugin-markdown": "3.0.0", "finalhandler": "1.2.0", "mocha": "10.0.0", From f76ecfd32f0a4a1f036058c3390162355fec73bf Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 23 Sep 2022 20:16:59 -0400 Subject: [PATCH 11/34] build: Node.js@18.9 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d624fe..5a712be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,7 @@ jobs: node-version: "17.9" - name: Node.js 18.x - node-version: "18.7" + node-version: "18.9" steps: - uses: actions/checkout@v2 From 5a99eb6c84e518947bab263f7b359cc9be1543c5 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Tue, 25 Oct 2022 19:33:15 -0400 Subject: [PATCH 12/34] build: supertest@6.3.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ee39c93..a904e95 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "mocha": "10.0.0", "nyc": "15.1.0", "safe-buffer": "5.2.1", - "supertest": "6.2.4" + "supertest": "6.3.1" }, "files": [ "lib/", From 806dfe51b735cfc5ea19329aa6dce50ad67ebf21 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Wed, 2 Nov 2022 23:40:06 -0400 Subject: [PATCH 13/34] build: Node.js@14.21 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a712be..f3c611b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,7 +99,7 @@ jobs: npm-i: mocha@9.2.2 - name: Node.js 14.x - node-version: "14.20" + node-version: "14.21" - name: Node.js 15.x node-version: "15.14" From 7b0fad14fb6ebba56a36713fb0437af11354e52c Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Wed, 2 Nov 2022 23:42:15 -0400 Subject: [PATCH 14/34] build: Node.js@16.18 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3c611b..85c7fc5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,7 @@ jobs: node-version: "15.14" - name: Node.js 16.x - node-version: "16.17" + node-version: "16.18" - name: Node.js 17.x node-version: "17.9" From a8d531bf6b9aa9ac886e3d16c06022b4cfba72c6 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sat, 19 Nov 2022 21:54:26 -0500 Subject: [PATCH 15/34] build: eslint@8.28.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a904e95..5ec8b6d 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "after": "0.8.2", - "eslint": "8.24.0", + "eslint": "8.28.0", "eslint-plugin-markdown": "3.0.0", "finalhandler": "1.2.0", "mocha": "10.0.0", From 99b60b1993b95f41d65cbb0843b5eda6c6765081 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Thu, 1 Dec 2022 19:33:55 -0500 Subject: [PATCH 16/34] build: Node.js@18.12 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85c7fc5..46e2091 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,7 @@ jobs: node-version: "17.9" - name: Node.js 18.x - node-version: "18.9" + node-version: "18.12" steps: - uses: actions/checkout@v2 From 5b4ceadc30185ee06ed980e2f012329458a3c320 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Thu, 1 Dec 2022 19:39:01 -0500 Subject: [PATCH 17/34] build: support Node.js 19.x --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46e2091..3d0e131 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,7 @@ jobs: - Node.js 16.x - Node.js 17.x - Node.js 18.x + - Node.js 19.x include: - name: Node.js 0.8 @@ -113,6 +114,9 @@ jobs: - name: Node.js 18.x node-version: "18.12" + - name: Node.js 19.x + node-version: "19.2" + steps: - uses: actions/checkout@v2 From 3e79ad912b69fde07405f0dd1950e01a6fdeca30 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Wed, 28 Dec 2022 20:01:44 -0500 Subject: [PATCH 18/34] build: mocha@10.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ec8b6d..2369ff0 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "eslint": "8.28.0", "eslint-plugin-markdown": "3.0.0", "finalhandler": "1.2.0", - "mocha": "10.0.0", + "mocha": "10.2.0", "nyc": "15.1.0", "safe-buffer": "5.2.1", "supertest": "6.3.1" From 20b8fc66402856ce4390f0c6bac1fb58677ec1fe Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Wed, 28 Dec 2022 20:05:19 -0500 Subject: [PATCH 19/34] build: supertest@6.3.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2369ff0..740ac92 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "mocha": "10.2.0", "nyc": "15.1.0", "safe-buffer": "5.2.1", - "supertest": "6.3.1" + "supertest": "6.3.3" }, "files": [ "lib/", From ba19a6485fe09a6dc883be2a8c584bc966926350 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Tue, 24 Jan 2023 21:14:01 -0500 Subject: [PATCH 20/34] build: Node.js@16.19 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d0e131..7c046db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,7 +106,7 @@ jobs: node-version: "15.14" - name: Node.js 16.x - node-version: "16.18" + node-version: "16.19" - name: Node.js 17.x node-version: "17.9" From 8cd3849cbbd43d4782b140b4c37c65090be63450 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Tue, 24 Jan 2023 21:14:13 -0500 Subject: [PATCH 21/34] build: Node.js@18.13 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c046db..533a46b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,7 @@ jobs: node-version: "17.9" - name: Node.js 18.x - node-version: "18.12" + node-version: "18.13" - name: Node.js 19.x node-version: "19.2" From 6264a1d22f49c966b0b3f42a06e54cd209d7a8f7 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Tue, 24 Jan 2023 21:14:45 -0500 Subject: [PATCH 22/34] build: eslint@8.32.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 740ac92..95f4d2d 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "after": "0.8.2", - "eslint": "8.28.0", + "eslint": "8.32.0", "eslint-plugin-markdown": "3.0.0", "finalhandler": "1.2.0", "mocha": "10.2.0", From 15d9a4857c0cbc0da8a510a1943b60f3e015a02e Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Tue, 24 Jan 2023 21:53:55 -0500 Subject: [PATCH 23/34] build: Node.js@19.5 --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 533a46b..077d009 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,7 @@ jobs: node-version: "18.13" - name: Node.js 19.x - node-version: "19.2" + node-version: "19.5" steps: - uses: actions/checkout@v2 @@ -133,7 +133,12 @@ jobs: dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" - name: Configure npm - run: npm config set shrinkwrap false + run: | + if [[ "$(npm config get package-lock)" == "true" ]]; then + npm config set package-lock false + else + npm config set shrinkwrap false + fi - name: Remove npm module(s) ${{ matrix.npm-rm }} run: npm rm --silent --save-dev ${{ matrix.npm-rm }} From 5665cf7cdb0d690224fdf8e87ccd7a4c8e35fb81 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Thu, 23 Feb 2023 23:19:17 -0500 Subject: [PATCH 24/34] build: Node.js@19.7 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 077d009..6a8d231 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,7 @@ jobs: node-version: "18.13" - name: Node.js 19.x - node-version: "19.5" + node-version: "19.7" steps: - uses: actions/checkout@v2 From f06b5f8440b3edaf3b33209e6f20459b0f69ef15 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Thu, 23 Feb 2023 23:22:09 -0500 Subject: [PATCH 25/34] build: Node.js@18.14 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a8d231..1e81f9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,7 @@ jobs: node-version: "17.9" - name: Node.js 18.x - node-version: "18.13" + node-version: "18.14" - name: Node.js 19.x node-version: "19.7" From 14bc38f9f8e7f85140f34dbdf05fb6cf06cd697e Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 24 Feb 2023 11:30:58 -0500 Subject: [PATCH 26/34] build: eslint@8.34.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 95f4d2d..f0faacf 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "after": "0.8.2", - "eslint": "8.32.0", + "eslint": "8.34.0", "eslint-plugin-markdown": "3.0.0", "finalhandler": "1.2.0", "mocha": "10.2.0", From 33a76a9512ca0cc048c7c3bf7d284b061a4f16ef Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 24 Feb 2023 11:34:02 -0500 Subject: [PATCH 27/34] build: actions/checkout@v3 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e81f9c..fad8a39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,7 +118,7 @@ jobs: node-version: "19.7" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Node.js ${{ matrix.node-version }} shell: bash -eo pipefail -l {0} @@ -207,7 +207,7 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install lcov shell: bash From b4ee44bff267b8b9236162ef58028309858ac997 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 24 Feb 2023 11:34:53 -0500 Subject: [PATCH 28/34] build: actions/upload-artifact@v3 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fad8a39..a507e1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,7 +195,7 @@ jobs: mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}" fi - name: Upload code coverage - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: steps.list_env.outputs.nyc != '' with: From 1f1dffdb49db38b0edd081db82fffc6bdcfde9dd Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 24 Feb 2023 11:36:26 -0500 Subject: [PATCH 29/34] build: use $GITHUB_OUTPUT for environment list --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a507e1c..a570a3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,7 +170,7 @@ jobs: echo "node@$(node -v)" echo "npm@$(npm -v)" npm -s ls ||: - (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }' + (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print $2 "=" $3 }' >> "$GITHUB_OUTPUT" - name: Run tests shell: bash From ceddead15a8396364e2beab17792d133f0d7d045 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 24 Feb 2023 11:38:26 -0500 Subject: [PATCH 30/34] build: actions/download-artifact@v3 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a570a3c..dd384f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -214,7 +214,7 @@ jobs: run: sudo apt-get -y install lcov - name: Collect coverage reports - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: coverage path: ./coverage From 86a5f765838d863419c75e80a4f1dda9759657b7 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 24 Feb 2023 11:39:26 -0500 Subject: [PATCH 31/34] 1.3.8 --- HISTORY.md | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 5e42df5..0ca0844 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,5 @@ -unreleased -========== +1.3.8 / 2023-02-24 +================== * Fix routing requests without method diff --git a/package.json b/package.json index f0faacf..5279b12 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "router", "description": "Simple middleware-style router", - "version": "1.3.7", + "version": "1.3.8", "author": "Douglas Christopher Wilson ", "contributors": [ "Blake Embrey " From 361202d7f89aea10666304aced526b855966b2e5 Mon Sep 17 00:00:00 2001 From: Wes Todd Date: Sat, 16 Mar 2024 11:59:10 -0500 Subject: [PATCH 32/34] build: enable ci workflow trigger --- .github/workflows/ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd384f4..3fe1bd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,18 @@ name: ci on: -- pull_request -- push + workflow_dispatch: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened, ready_for_review] jobs: test: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: name: - Node.js 0.8 @@ -77,11 +82,11 @@ jobs: - name: Node.js 8.x node-version: "8.17" - npm-i: mocha@7.2.0 + npm-i: mocha@7.2.0 nyc@14.1.1 - name: Node.js 9.x node-version: "9.11" - npm-i: mocha@7.2.0 + npm-i: mocha@7.2.0 nyc@14.1.1 - name: Node.js 10.x node-version: "10.24" From d40e4b0cef309d49e856217f968480b24c9f11fb Mon Sep 17 00:00:00 2001 From: Wes Todd Date: Sat, 16 Mar 2024 12:45:20 -0500 Subject: [PATCH 33/34] build: legacy-peer-deps in new node --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f308fb..18be98d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,18 +103,23 @@ jobs: - name: Node.js 15.x node-version: "15.14" + legacy-peer-deps: true - name: Node.js 16.x node-version: "16.19" + legacy-peer-deps: true - name: Node.js 17.x node-version: "17.9" + legacy-peer-deps: true - name: Node.js 18.x node-version: "18.14" + legacy-peer-deps: true - name: Node.js 19.x node-version: "19.7" + legacy-peer-deps: true steps: - uses: actions/checkout@v3 @@ -150,7 +155,7 @@ jobs: fi - name: Install Node.js dependencies - run: npm install + run: ${{ matrix.legacy-peer-deps && 'npm install --legacy-peer-deps' || 'npm install' }} - name: List environment id: list_env From 4835526ce05e287bc418acb78ce528b353398af1 Mon Sep 17 00:00:00 2001 From: Wes Todd Date: Sat, 16 Mar 2024 12:47:52 -0500 Subject: [PATCH 34/34] lint: fix lint in ci --- lib/route.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/route.js b/lib/route.js index 7a22f55..2a17763 100644 --- a/lib/route.js +++ b/lib/route.js @@ -110,7 +110,7 @@ Route.prototype.dispatch = function dispatch (req, res, done) { ? req.method.toLowerCase() : req.method - if (method === 'head' && !this.methods['head']) { + if (method === 'head' && !this.methods.head) { method = 'get' }