@defra/lis-hubs-infra-access 0.22.0 → 0.23.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/lis-hubs-infra-access",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Shared hub access and capability resolution for the livestock platform.",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -108,6 +108,8 @@ export function buildHubLoginUrl({ hubOrigin, returnUrl }) {
108
108
  }
109
109
 
110
110
  /**
111
+ * Assets count as public only at the start of the path - never anywhere
112
+ * in it, or a route such as /holdings/public/x/y would skip authentication.
111
113
  * @param {Request} request
112
114
  * @param {string} assetPath
113
115
  * @returns {boolean}
@@ -117,8 +119,7 @@ export function isPublicRequest(request, assetPath) {
117
119
  request.path === '/favicon.ico' ||
118
120
  request.path === '/health' ||
119
121
  request.path === assetPath ||
120
- request.path.startsWith(`${assetPath}/`) ||
121
- request.path.includes(`${assetPath}/`)
122
+ request.path.startsWith(`${assetPath}/`)
122
123
  )
123
124
  }
124
125