Skip to content

Commit 0cf3aa5

Browse files
committed
Cleanup
1 parent 8577b1f commit 0cf3aa5

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

apps/sim/tools/http/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ export interface WebhookRequestParams {
2222
url: string
2323
body?: any
2424
secret?: string
25-
headers?: TableRow[]
25+
headers?: Record<string, string>
2626
}

apps/sim/tools/http/webhook_request.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { createHmac } from 'crypto'
22
import { v4 as uuidv4 } from 'uuid'
33
import type { ToolConfig } from '@/tools/types'
44
import type { RequestResponse, WebhookRequestParams } from './types'
5-
import { transformTable } from './utils'
65

76
/**
87
* Generates HMAC-SHA256 signature for webhook payload
@@ -64,18 +63,7 @@ export const webhookRequestTool: ToolConfig<WebhookRequestParams, RequestRespons
6463
}
6564

6665
// Merge with user-provided headers (user headers take precedence)
67-
// Handle different header formats:
68-
// - Array of TableRow objects (from block usage): [{ cells: { Key, Value } }]
69-
// - Plain object (from direct tool usage): { key: value }
70-
// - undefined/null
71-
let userHeaders: Record<string, string> = {}
72-
if (params.headers) {
73-
if (Array.isArray(params.headers)) {
74-
userHeaders = transformTable(params.headers)
75-
} else if (typeof params.headers === 'object') {
76-
userHeaders = params.headers as Record<string, string>
77-
}
78-
}
66+
const userHeaders = params.headers || {}
7967

8068
return { ...webhookHeaders, ...userHeaders }
8169
},

0 commit comments

Comments
 (0)