Browse Source

Merge pull request #7056 from nocodb/fix/default-content-type

fix: use json as default content type for webhooks
pull/6949/head
mertmit 10 months ago committed by GitHub
parent
commit
cdc7f97476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      packages/nocodb/src/helpers/webhookHelpers.ts

12
packages/nocodb/src/helpers/webhookHelpers.ts

@ -182,6 +182,18 @@ export async function handleHttpWebHook(
prevData, prevData,
newData, newData,
): Promise<any> { ): Promise<any> {
const contentType = apiMeta.headers?.find(
(header) => header.name?.toLowerCase() === 'content-type' && header.enabled,
);
if (!contentType) {
apiMeta.headers.push({
name: 'Content-Type',
enabled: true,
value: 'application/json',
});
}
const req = axiosRequestMake( const req = axiosRequestMake(
apiMeta, apiMeta,
user, user,

Loading…
Cancel
Save