File tree Expand file tree Collapse file tree 4 files changed +14
-10
lines changed Expand file tree Collapse file tree 4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 17
17
18
18
jobs :
19
19
test :
20
- uses : fastify/workflows/.github/workflows/plugins-ci.yml@v3
20
+ uses : fastify/workflows/.github/workflows/plugins-ci.yml@v4.0.0
21
21
with :
22
22
license-check : true
23
23
lint : true
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ lib-cov
23
23
coverage
24
24
* .lcov
25
25
26
+ # .tap output
27
+ .tap
28
+
26
29
# nyc test coverage
27
30
.nyc_output
28
31
Original file line number Diff line number Diff line change 29
29
},
30
30
"homepage" : " https://github.com/fastify/fastify-url-data#readme" ,
31
31
"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 " ,
35
35
"h2url" : " ^0.2.0" ,
36
- "semver" : " ^7.3.2 " ,
36
+ "semver" : " ^7.5.4 " ,
37
37
"snazzy" : " ^9.0.0" ,
38
- "standard" : " ^17.0 .0" ,
39
- "tap" : " ^16.0.0 " ,
38
+ "standard" : " ^17.1 .0" ,
39
+ "tap" : " ^18.6.1 " ,
40
40
"tsd" : " ~0.31.0"
41
41
},
42
42
"dependencies" : {
43
43
"fast-uri" : " ^3.0.0" ,
44
- "fastify-plugin" : " ^4.0.0 "
44
+ "fastify-plugin" : " ^4.5.1 "
45
45
},
46
46
"publishConfig" : {
47
47
"access" : " public"
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const fp = require ( 'fastify-plugin' )
4
- const fastUri = require ( 'fast-uri' )
4
+ const { parse } = require ( 'fast-uri' )
5
5
6
6
function fastifyUrlData ( fastify , options , next ) {
7
7
fastify . decorateRequest ( 'urlData' , function ( key ) {
8
8
const scheme = this . headers [ ':scheme' ] ? this . headers [ ':scheme' ] : this . protocol
9
9
const host = this . hostname
10
+ const port = this . port
10
11
const path = this . headers [ ':path' ] || this . raw . url
11
- const urlData = fastUri . parse ( scheme + ' ://' + host + path )
12
+ const urlData = parse ( ` ${ scheme } ://${ host } : ${ port } ${ path } ` )
12
13
if ( key ) return urlData [ key ]
13
14
return urlData
14
15
} )
You can’t perform that action at this time.
0 commit comments