mirror of
https://github.com/fosrl/pangolin.git
synced 2026-04-29 01:08:13 +00:00
Update websocket to be consistant with streaming
This commit is contained in:
@@ -55,7 +55,7 @@ export async function sendAlertWebhook(
|
||||
let response: Response;
|
||||
try {
|
||||
response = await fetch(url, {
|
||||
method: "POST",
|
||||
method: webhookConfig.method ?? "POST",
|
||||
headers,
|
||||
body,
|
||||
signal: controller.signal
|
||||
@@ -128,5 +128,13 @@ function buildHeaders(webhookConfig: WebhookAlertConfig): Record<string, string>
|
||||
break;
|
||||
}
|
||||
|
||||
if (webhookConfig.headers) {
|
||||
for (const { key, value } of webhookConfig.headers) {
|
||||
if (key.trim()) {
|
||||
headers[key.trim()] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
Reference in New Issue
Block a user