@fastify/express 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -5
- package/package.json +7 -7
package/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const fp = require('fastify-plugin')
|
|
4
|
-
const symbols = require('fastify/lib/symbols')
|
|
5
4
|
const Express = require('express')
|
|
6
5
|
const kMiddlewares = Symbol('fastify-express-middlewares')
|
|
7
6
|
|
|
@@ -22,7 +21,7 @@ function expressPlugin (fastify, options, next) {
|
|
|
22
21
|
|
|
23
22
|
function use (path, fn) {
|
|
24
23
|
if (typeof path === 'string') {
|
|
25
|
-
const prefix = this
|
|
24
|
+
const prefix = this.prefix
|
|
26
25
|
path = prefix + (path === '/' && prefix.length > 0 ? '' : path)
|
|
27
26
|
}
|
|
28
27
|
this[kMiddlewares].push([path, fn])
|
|
@@ -52,12 +51,10 @@ function expressPlugin (fastify, options, next) {
|
|
|
52
51
|
req.raw.cookies = req.cookies
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
const originalProtocol = req.raw.protocol
|
|
56
54
|
// Make it lazy as it does a bit of work
|
|
57
55
|
Object.defineProperty(req.raw, 'protocol', {
|
|
58
56
|
get () {
|
|
59
|
-
|
|
60
|
-
return req.protocol || originalProtocol
|
|
57
|
+
return req.protocol
|
|
61
58
|
}
|
|
62
59
|
})
|
|
63
60
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastify/express",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Express compatibility layer for Fastify",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "standard && tap --no-coverage test/*.test.js && tsd"
|
|
9
|
-
},
|
|
10
7
|
"repository": {
|
|
11
8
|
"type": "git",
|
|
12
9
|
"url": "git+https://github.com/fastify/fastify-express.git"
|
|
@@ -31,14 +28,14 @@
|
|
|
31
28
|
"cors": "^2.8.5",
|
|
32
29
|
"fastify": "^4.0.0-rc.3",
|
|
33
30
|
"@fastify/formbody": "^7.0.1",
|
|
34
|
-
"helmet": "^
|
|
31
|
+
"helmet": "^6.0.0",
|
|
35
32
|
"passport": "^0.6.0",
|
|
36
33
|
"passport-http-bearer": "^1.0.1",
|
|
37
34
|
"serve-static": "^1.14.1",
|
|
38
35
|
"simple-get": "^4.0.0",
|
|
39
36
|
"standard": "^17.0.0",
|
|
40
37
|
"tap": "^16.0.0",
|
|
41
|
-
"tsd": "^0.
|
|
38
|
+
"tsd": "^0.24.1"
|
|
42
39
|
},
|
|
43
40
|
"dependencies": {
|
|
44
41
|
"express": "^4.17.1",
|
|
@@ -49,5 +46,8 @@
|
|
|
49
46
|
},
|
|
50
47
|
"publishConfig": {
|
|
51
48
|
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"test": "standard && tap --no-coverage test/*.test.js && tsd"
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}
|