mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-16 01:23:18 +02:00
Fix segault in ntfy pub
This commit is contained in:
parent
04cc71af90
commit
dc8932cd95
5 changed files with 13 additions and 2 deletions
client
|
@ -97,7 +97,10 @@ func (c *Client) Publish(topic, message string, options ...PublishOption) (*Mess
|
|||
// WithNoFirebase, and the generic WithHeader.
|
||||
func (c *Client) PublishReader(topic string, body io.Reader, options ...PublishOption) (*Message, error) {
|
||||
topicURL := c.expandTopicURL(topic)
|
||||
req, _ := http.NewRequest("POST", topicURL, body)
|
||||
req, err := http.NewRequest("POST", topicURL, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, option := range options {
|
||||
if err := option(req); err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue