From 3acf1496327ee2eb3fb58302eb2ed90e11a1ed7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrg=C3=BCn=20Day=C4=B1o=C4=9Flu?= Date: Thu, 25 Jan 2024 10:25:21 +0100 Subject: [PATCH 1/4] update for v5 (#140) --- .github/workflows/ci.yml | 2 +- .gitignore | 3 +++ package.json | 18 +++++++++--------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b00276..ad3ab6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ on: jobs: test: - uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3 + uses: fastify/workflows/.github/workflows/plugins-ci.yml@v4.0.0 with: license-check: true lint: true diff --git a/.gitignore b/.gitignore index bc7a8ad..fb74f9e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,9 @@ lib-cov coverage *.lcov +# .tap output +.tap + # nyc test coverage .nyc_output diff --git a/package.json b/package.json index 985ac70..363f228 100644 --- a/package.json +++ b/package.json @@ -29,19 +29,19 @@ }, "homepage": "https://github.com/fastify/fastify-url-data#readme", "devDependencies": { - "@fastify/pre-commit": "^2.0.2", - "@types/node": "^20.1.0", - "fastify": "^4.0.0-rc.2", + "@fastify/pre-commit": "^2.1.0", + "@types/node": "^20.11.6", + "fastify": "^4.25.2", "h2url": "^0.2.0", - "semver": "^7.3.2", + "semver": "^7.5.4", "snazzy": "^9.0.0", - "standard": "^17.0.0", - "tap": "^16.0.0", - "tsd": "~0.30.0" + "standard": "^17.1.0", + "tap": "^18.6.1", + "tsd": "~0.30.4" }, "dependencies": { - "fast-uri": "^2.2.0", - "fastify-plugin": "^4.0.0" + "fast-uri": "^2.3.0", + "fastify-plugin": "^4.5.1" }, "publishConfig": { "access": "public" From d8861f437e7e6dc5869b94fbed82237ebe270f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrg=C3=BCn=20Day=C4=B1o=C4=9Flu?= Date: Thu, 25 Jan 2024 10:25:21 +0100 Subject: [PATCH 2/4] update for v5 (#140) --- .github/workflows/ci.yml | 2 +- .gitignore | 3 +++ package.json | 14 +++++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b00276..ad3ab6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ on: jobs: test: - uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3 + uses: fastify/workflows/.github/workflows/plugins-ci.yml@v4.0.0 with: license-check: true lint: true diff --git a/.gitignore b/.gitignore index 5c8d99a..442fb4a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,9 @@ lib-cov coverage *.lcov +# .tap output +.tap + # nyc test coverage .nyc_output diff --git a/package.json b/package.json index f2030a4..0449767 100644 --- a/package.json +++ b/package.json @@ -29,19 +29,19 @@ }, "homepage": "https://github.com/fastify/fastify-url-data#readme", "devDependencies": { - "@fastify/pre-commit": "^2.0.2", - "@types/node": "^20.1.0", - "fastify": "^4.0.0-rc.2", + "@fastify/pre-commit": "^2.1.0", + "@types/node": "^20.11.6", + "fastify": "^4.25.2", "h2url": "^0.2.0", - "semver": "^7.3.2", + "semver": "^7.5.4", "snazzy": "^9.0.0", - "standard": "^17.0.0", - "tap": "^16.0.0", + "standard": "^17.1.0", + "tap": "^18.6.1", "tsd": "~0.31.0" }, "dependencies": { "fast-uri": "^3.0.0", - "fastify-plugin": "^4.0.0" + "fastify-plugin": "^4.5.1" }, "publishConfig": { "access": "public" From 39582264a74b991e92005a2351195ee37315fe66 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Fri, 12 Jul 2024 08:31:04 -0400 Subject: [PATCH 3/4] update fastify deps --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0449767..82292c1 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "devDependencies": { "@fastify/pre-commit": "^2.1.0", "@types/node": "^20.11.6", - "fastify": "^4.25.2", + "fastify": "^5.0.0-alpha.3", "h2url": "^0.2.0", "semver": "^7.5.4", "snazzy": "^9.0.0", From 9f96b7712d86bc836ed7880bfb9a0dea42aaeeb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrg=C3=BCn=20Day=C4=B1o=C4=9Flu?= Date: Sat, 13 Jul 2024 22:03:45 +0300 Subject: [PATCH 4/4] Fix port parsing (#148) --- plugin.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin.js b/plugin.js index fec8923..5e6a54b 100644 --- a/plugin.js +++ b/plugin.js @@ -1,14 +1,15 @@ 'use strict' const fp = require('fastify-plugin') -const fastUri = require('fast-uri') +const { parse } = require('fast-uri') function fastifyUrlData (fastify, options, next) { fastify.decorateRequest('urlData', function (key) { const scheme = this.headers[':scheme'] ? this.headers[':scheme'] : this.protocol const host = this.hostname + const port = this.port const path = this.headers[':path'] || this.raw.url - const urlData = fastUri.parse(scheme + '://' + host + path) + const urlData = parse(`${scheme}://${host}:${port}${path}`) if (key) return urlData[key] return urlData })