We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 567f7a5 commit 00f893eCopy full SHA for 00f893e
1 file changed
apps/sim/middleware.ts
@@ -99,8 +99,14 @@ export async function middleware(request: NextRequest) {
99
}
100
101
const userAgent = request.headers.get('user-agent') || ''
102
+
103
+ // Check if this is a webhook endpoint that should be exempt from User-Agent validation
104
+ const isWebhookEndpoint = url.pathname.startsWith('/api/webhooks/trigger/')
105
106
const isSuspicious = SUSPICIOUS_UA_PATTERNS.some((pattern) => pattern.test(userAgent))
- if (isSuspicious) {
107
108
+ // Block suspicious requests, but exempt webhook endpoints from User-Agent validation only
109
+ if (isSuspicious && !isWebhookEndpoint) {
110
logger.warn('Blocked suspicious request', {
111
userAgent,
112
ip: request.headers.get('x-forwarded-for') || 'unknown',
0 commit comments