@trenskow/app 0.9.6 → 0.9.8
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/lib/endpoint.js +2 -2
- package/package.json +2 -2
package/lib/endpoint.js
CHANGED
|
@@ -238,12 +238,12 @@ export default class Endpoint extends Router {
|
|
|
238
238
|
|
|
239
239
|
let underlyingMethod = context.request.method.toLowerCase();
|
|
240
240
|
|
|
241
|
-
if (underlyingMethod === 'head' && !this._layers.some((layer) => layer.methods
|
|
241
|
+
if (underlyingMethod === 'head' && !this._layers.some((layer) => layer.methods?.includes('head'))) {
|
|
242
242
|
underlyingMethod = 'get';
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
if (layer.match === 'direct' && !path.isLast) return await next();
|
|
246
|
-
if (!layer.methods
|
|
246
|
+
if (!layer.methods?.includes(underlyingMethod)) return await next();
|
|
247
247
|
|
|
248
248
|
for (let handler of layer.handlers) {
|
|
249
249
|
const result = await handler(context);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trenskow/app",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
4
4
|
"description": "A small HTTP router.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"supertest": "^7.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@trenskow/api-error": "^2.5.
|
|
37
|
+
"@trenskow/api-error": "^2.5.17",
|
|
38
38
|
"@trenskow/caseit": "^1.4.6"
|
|
39
39
|
}
|
|
40
40
|
}
|