@budibase/server 3.31.6 → 3.31.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "3.31.6",
4
+ "version": "3.31.8",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -220,5 +220,5 @@
220
220
  }
221
221
  }
222
222
  },
223
- "gitHead": "431d595ada96873e3b6ff34e80a2f710f5ad5051"
223
+ "gitHead": "40ce480c77f85ee638b4eab232041fa877db5fb4"
224
224
  }
@@ -216,7 +216,14 @@ export async function processPWAZip(ctx: UserCtx) {
216
216
  const appId = context.getProdWorkspaceId()
217
217
 
218
218
  for (const icon of iconsData.icons) {
219
- if (!icon.src || !icon.sizes || !fs.existsSync(join(baseDir, icon.src))) {
219
+ const resolvedSrc = icon.src ? path.resolve(baseDir, icon.src) : undefined
220
+ if (
221
+ !icon.src ||
222
+ !icon.sizes ||
223
+ !resolvedSrc ||
224
+ !resolvedSrc.startsWith(baseDir + path.sep) ||
225
+ !fs.existsSync(resolvedSrc)
226
+ ) {
220
227
  continue
221
228
  }
222
229
 
@@ -229,7 +236,7 @@ export async function processPWAZip(ctx: UserCtx) {
229
236
  const result = await objectStore.upload({
230
237
  bucket: ObjectStoreBuckets.APPS,
231
238
  filename: key,
232
- path: join(baseDir, icon.src),
239
+ path: resolvedSrc,
233
240
  type: mimeType,
234
241
  })
235
242
 
@@ -1,24 +1,19 @@
1
1
  import { LoginMethod, UserCtx } from "@budibase/types"
2
2
 
3
3
  const WEBHOOK_ENDPOINTS = new RegExp(
4
- [
5
- "webhooks/trigger",
6
- "webhooks/schema",
7
- "webhooks/discord",
8
- "webhooks/ms-teams",
9
- "webhooks/slack",
10
- ].join("|")
4
+ "^/api/webhooks/(trigger|schema|discord|ms-teams|slack)(/|$)"
11
5
  )
12
6
 
13
- export function isWebhookEndpoint(ctx: UserCtx) {
14
- return WEBHOOK_ENDPOINTS.test(ctx.request.url)
7
+ export function isWebhookEndpoint(ctx: UserCtx): boolean {
8
+ const path = ctx.path || ctx.request.url.split("?")[0]
9
+ return WEBHOOK_ENDPOINTS.test(path)
15
10
  }
16
11
 
17
- export function isBrowser(ctx: UserCtx) {
12
+ export function isBrowser(ctx: UserCtx): boolean {
18
13
  const browser = ctx.userAgent?.browser
19
- return browser && browser !== "unknown"
14
+ return !!browser && browser !== "unknown"
20
15
  }
21
16
 
22
- export function isApiKey(ctx: UserCtx) {
17
+ export function isApiKey(ctx: UserCtx): boolean {
23
18
  return ctx.loginMethod === LoginMethod.API_KEY
24
19
  }