fix: fix error handling for empty HTTP responses

- Change the condition to check for `http.StatusNoContent` instead of `http.StatusOK` before returning an error.

Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
appleboy
2025-03-08 16:53:12 +08:00
parent e80db3da6a
commit cea35a9ac9
+1 -1
View File
@@ -283,7 +283,7 @@ func (p *Plugin) SendMessage(ctx context.Context) error {
} }
defer resp.Body.Close() defer resp.Body.Close()
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusNoContent {
return fmt.Errorf("failed to send message, status code: %d", resp.StatusCode) return fmt.Errorf("failed to send message, status code: %d", resp.StatusCode)
} }