fix: harden rule and forwarding edge cases
This commit is contained in:
@@ -72,7 +72,12 @@ func postAlertPayload(cfg *config.AlertForwardConf, path string, payload []byte)
|
||||
if cfg.InternalKey != "" {
|
||||
req.Header.Set("X-Internal-Key", cfg.InternalKey)
|
||||
}
|
||||
client := &http.Client{Timeout: 10 * time.Second}
|
||||
client := &http.Client{
|
||||
Timeout: 10 * time.Second,
|
||||
CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
|
||||
return http.ErrUseLastResponse
|
||||
},
|
||||
}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return fmt.Errorf("发送 Alert 转发请求失败:%w", err)
|
||||
|
||||
Reference in New Issue
Block a user