forked from lug/matterbridge
Update dependencies (#1851)
This commit is contained in:
8
vendor/github.com/slack-go/slack/webhooks.go
generated
vendored
8
vendor/github.com/slack-go/slack/webhooks.go
generated
vendored
@@ -5,6 +5,8 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -21,6 +23,7 @@ type WebhookMessage struct {
|
||||
ResponseType string `json:"response_type,omitempty"`
|
||||
ReplaceOriginal bool `json:"replace_original,omitempty"`
|
||||
DeleteOriginal bool `json:"delete_original,omitempty"`
|
||||
ReplyBroadcast bool `json:"reply_broadcast,omitempty"`
|
||||
}
|
||||
|
||||
func PostWebhook(url string, msg *WebhookMessage) error {
|
||||
@@ -51,7 +54,10 @@ func PostWebhookCustomHTTPContext(ctx context.Context, url string, httpClient *h
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to post webhook: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer func() {
|
||||
io.Copy(ioutil.Discard, resp.Body)
|
||||
resp.Body.Close()
|
||||
}()
|
||||
|
||||
return checkStatusCode(resp, discard{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user