Skip to content

Commit f69b584

Browse files
jsumnersgurgunday
andauthored
Merge next into master (#147)
* update for v5 (#140) * update for v5 (#140) * update fastify deps * Fix port parsing (#148) --------- Co-authored-by: Gürgün Dayıoğlu <[email protected]> Co-authored-by: Gürgün Dayıoğlu <[email protected]>
1 parent a1cfd7b commit f69b584

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
test:
20-
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
20+
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v4.0.0
2121
with:
2222
license-check: true
2323
lint: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ lib-cov
2323
coverage
2424
*.lcov
2525

26+
# .tap output
27+
.tap
28+
2629
# nyc test coverage
2730
.nyc_output
2831

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@
2929
},
3030
"homepage": "https://github.com/fastify/fastify-url-data#readme",
3131
"devDependencies": {
32-
"@fastify/pre-commit": "^2.0.2",
33-
"@types/node": "^20.1.0",
34-
"fastify": "^4.0.0-rc.2",
32+
"@fastify/pre-commit": "^2.1.0",
33+
"@types/node": "^20.11.6",
34+
"fastify": "^5.0.0-alpha.3",
3535
"h2url": "^0.2.0",
36-
"semver": "^7.3.2",
36+
"semver": "^7.5.4",
3737
"snazzy": "^9.0.0",
38-
"standard": "^17.0.0",
39-
"tap": "^16.0.0",
38+
"standard": "^17.1.0",
39+
"tap": "^18.6.1",
4040
"tsd": "~0.31.0"
4141
},
4242
"dependencies": {
4343
"fast-uri": "^3.0.0",
44-
"fastify-plugin": "^4.0.0"
44+
"fastify-plugin": "^4.5.1"
4545
},
4646
"publishConfig": {
4747
"access": "public"

plugin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
'use strict'
22

33
const fp = require('fastify-plugin')
4-
const fastUri = require('fast-uri')
4+
const { parse } = require('fast-uri')
55

66
function fastifyUrlData (fastify, options, next) {
77
fastify.decorateRequest('urlData', function (key) {
88
const scheme = this.headers[':scheme'] ? this.headers[':scheme'] : this.protocol
99
const host = this.hostname
10+
const port = this.port
1011
const path = this.headers[':path'] || this.raw.url
11-
const urlData = fastUri.parse(scheme + '://' + host + path)
12+
const urlData = parse(`${scheme}://${host}:${port}${path}`)
1213
if (key) return urlData[key]
1314
return urlData
1415
})

0 commit comments

Comments
 (0)