@jsenv/server 17.6.2 → 17.6.3

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.
@@ -6452,7 +6452,10 @@ It should be should be one of route.${routePropertyName}: ${availableValues.join
6452
6452
  }
6453
6453
  }
6454
6454
  if (!route.matchMethod(request.method)) {
6455
- if (!route.isFallback) {
6455
+ // a 405 asserts the resource exists with other methods: a route
6456
+ // matching any resource ("GET *") cannot assert that, so it does
6457
+ // not turn an unknown resource into a 405
6458
+ if (!route.isFallback && route.resource !== "*") {
6456
6459
  wouldHaveMatched.methodSet.add(route.method);
6457
6460
  }
6458
6461
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/server",
3
- "version": "17.6.2",
3
+ "version": "17.6.3",
4
4
  "type": "module",
5
5
  "description": "A modern Node.js HTTP server with declarative routing, content negotiation, and WebSocket support",
6
6
  "repository": {
@@ -355,7 +355,10 @@ It should be should be one of route.${routePropertyName}: ${availableValues.join
355
355
  }
356
356
  }
357
357
  if (!route.matchMethod(request.method)) {
358
- if (!route.isFallback) {
358
+ // a 405 asserts the resource exists with other methods: a route
359
+ // matching any resource ("GET *") cannot assert that, so it does
360
+ // not turn an unknown resource into a 405
361
+ if (!route.isFallback && route.resource !== "*") {
359
362
  wouldHaveMatched.methodSet.add(route.method);
360
363
  }
361
364
  continue;