Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Remove webhook url length restriction

Steven Tey0cde746c0518
diff --git a/apps/web/lib/zod/schemas/webhooks.ts b/apps/web/lib/zod/schemas/webhooks.ts
index 4b52facd54..38fe9fdbc0 100644
--- a/apps/web/lib/zod/schemas/webhooks.ts
+++ b/apps/web/lib/zod/schemas/webhooks.ts
@@ -1,5 +1,6 @@
import { WEBHOOK_TRIGGERS } from "@/lib/webhook/constants";
import { z } from "zod";
+import { parseUrlSchema } from "./utils";
export const WebhookSchema = z.object({
id: z.string(),
@@ -14,7 +15,7 @@ export const WebhookSchema = z.object({
export const createWebhookSchema = z.object({
name: z.string().min(1).max(40),
- url: z.string().url().max(190),
+ url: parseUrlSchema,
secret: z.string().optional(),
triggers: z.array(z.enum(WEBHOOK_TRIGGERS)),
linkIds: z.array(z.string()).optional(),
diff --git a/packages/prisma/schema/webhook.prisma b/packages/prisma/schema/webhook.prisma
index 44c400eb7f..8c6291e37c 100644
--- a/packages/prisma/schema/webhook.prisma
+++ b/packages/prisma/schema/webhook.prisma
@@ -12,7 +12,7 @@ model Webhook {
installationId String? @unique // indicates which integration installation added the webhook
receiver WebhookReceiver @default(user)
name String
- url String
+ url String @db.LongText
secret String
triggers Json
consecutiveFailures Int @default(0)