@budibase/server 3.31.6 → 3.31.7
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/dist/automation.js +1 -1
- package/dist/automation.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/query.js +1 -1
- package/dist/query.js.map +1 -1
- package/package.json +2 -2
- package/src/middleware/utils.ts +7 -12
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.
|
|
4
|
+
"version": "3.31.7",
|
|
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": "
|
|
223
|
+
"gitHead": "3f40c0aa6474c00af5c456d8315d54264e6b45f8"
|
|
224
224
|
}
|
package/src/middleware/utils.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
}
|