This commit is contained in:
@@ -1,24 +1,9 @@
|
||||
package actions
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"net/http"
|
||||
"time"
|
||||
"github.com/d3m0k1d/BanForge/internal/config"
|
||||
)
|
||||
|
||||
func SendWebhook(url string, data []byte) (int, error) {
|
||||
client := &http.Client{
|
||||
Timeout: 30 * time.Second,
|
||||
}
|
||||
req, err := http.NewRequest("POST", url, bytes.NewReader(data))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
// #nosec G704 validating by admin
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return resp.StatusCode, nil
|
||||
func SendWebhook(action config.Action) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user