Skip to content

Commit 966cfc5

Browse files
feat: Normalize headers to lowercase keys and export WebhookVerificationError (#12)
* Normalize headers to lowercase before passing to svix * Export Seam aliased svix WebhookVerificationError * ci: Format code --------- Co-authored-by: Seam Bot <[email protected]>
1 parent 74de317 commit 966cfc5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/lib/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './seam-webhook.js'
2+
export { WebhookVerificationError as SeamWebhookVerificationError } from 'svix'

src/lib/seam-webhook.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export class SeamWebhook {
99
}
1010

1111
verify(payload: string, headers: Record<string, string>): SeamEvent {
12-
return this.#webhook.verify(payload, headers) as SeamEvent
12+
const normalizedHeaders = Object.fromEntries(
13+
Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value]),
14+
)
15+
16+
return this.#webhook.verify(payload, normalizedHeaders) as SeamEvent
1317
}
1418
}

0 commit comments

Comments
 (0)