@superhero/http-server 4.4.7 → 4.7.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.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default
|
|
2
|
+
{
|
|
3
|
+
isValid(request, session)
|
|
4
|
+
{
|
|
5
|
+
const
|
|
6
|
+
header = request.headers['accept'],
|
|
7
|
+
lowerCased = header.toLowerCase(),
|
|
8
|
+
accept = lowerCased.split(';')[0].split('*')[0].trim()
|
|
9
|
+
|
|
10
|
+
return [session.route['criteria.accept']].flat().some(supported =>
|
|
11
|
+
supported.startsWith(accept) || accept.startsWith(supported.split('*')[0]))
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default
|
|
2
|
+
{
|
|
3
|
+
isValid(request, session)
|
|
4
|
+
{
|
|
5
|
+
const
|
|
6
|
+
header = request.headers['content-type'],
|
|
7
|
+
lowerCased = header.toLowerCase(),
|
|
8
|
+
contentType = lowerCased.split(';')[0].split('*')[0].trim()
|
|
9
|
+
|
|
10
|
+
return [session.route['criteria.content-type']].flat().some(supported =>
|
|
11
|
+
supported.startsWith(contentType) || contentType.startsWith(supported.split('*')[0]))
|
|
12
|
+
}
|
|
13
|
+
}
|
package/index.js
CHANGED
|
@@ -254,7 +254,7 @@ export default class HttpServer
|
|
|
254
254
|
// non enumerable and non-configurable session properties
|
|
255
255
|
downstream : { value:downstream },
|
|
256
256
|
upstream : { value:upstream },
|
|
257
|
-
abortion : { value:abortion }
|
|
257
|
+
abortion : { value:abortion },
|
|
258
258
|
})
|
|
259
259
|
|
|
260
260
|
Object.defineProperty(session, 'view', { enumerable: true, value: new View(session) })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superhero/http-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "HTTP(S) server component supporting both HTTP 1.1 and HTTP 2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"http server",
|
|
@@ -22,18 +22,21 @@
|
|
|
22
22
|
"./*/*/*/*/*": "./*/*/*/*/*.js",
|
|
23
23
|
"./*/*/*/*/*/*": "./*/*/*/*/*/*.js"
|
|
24
24
|
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"syntax-check": "syntax-check",
|
|
27
|
+
"test": "syntax-check; node --test --test-reporter=@superhero/audit/reporter --experimental-test-coverage"
|
|
28
|
+
},
|
|
25
29
|
"dependencies": {
|
|
26
|
-
"@superhero/router": "
|
|
27
|
-
"@superhero/deep": "
|
|
28
|
-
"@superhero/log": "
|
|
29
|
-
"@superhero/id-name-generator": "
|
|
30
|
+
"@superhero/router": "4.7.0",
|
|
31
|
+
"@superhero/deep": "4.7.0",
|
|
32
|
+
"@superhero/log": "4.7.0",
|
|
33
|
+
"@superhero/id-name-generator": "4.7.0"
|
|
30
34
|
},
|
|
31
35
|
"devDependencies": {
|
|
32
|
-
"@superhero/
|
|
33
|
-
"@superhero/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"test": "node --trace-warnings --test --experimental-test-coverage"
|
|
36
|
+
"@superhero/audit": "4.7.0",
|
|
37
|
+
"@superhero/syntax-check": "0.0.2",
|
|
38
|
+
"@superhero/locator": "4.7.0",
|
|
39
|
+
"@superhero/http-request": "4.7.0"
|
|
37
40
|
},
|
|
38
41
|
"author": {
|
|
39
42
|
"name": "Erik Landvall",
|
|
@@ -41,6 +44,6 @@
|
|
|
41
44
|
},
|
|
42
45
|
"repository": {
|
|
43
46
|
"type": "git",
|
|
44
|
-
"url": "
|
|
47
|
+
"url": "https://github.com/superhero/http-server.git"
|
|
45
48
|
}
|
|
46
49
|
}
|