Skip to content

Commit

Permalink
make POST and JSON as notification defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
yusing committed Jan 31, 2025
1 parent 357897a commit 6ae391a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 9 additions & 0 deletions internal/notif/base.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package notif

import (
"net/http"
"net/url"
"strings"

Expand Down Expand Up @@ -45,3 +46,11 @@ func (base *ProviderBase) GetURL() string {
func (base *ProviderBase) GetToken() string {
return base.Token
}

func (base *ProviderBase) GetMethod() string {
return http.MethodPost
}

func (base *ProviderBase) GetMIMEType() string {
return "application/json"
}
10 changes: 0 additions & 10 deletions internal/notif/gotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ func (client *GotifyClient) GetURL() string {
return client.URL + gotifyMsgEndpoint
}

// GetMethod implements Provider.
func (client *GotifyClient) GetMethod() string {
return http.MethodPost
}

// GetMIMEType implements Provider.
func (client *GotifyClient) GetMIMEType() string {
return "application/json"
}

// MakeBody implements Provider.
func (client *GotifyClient) MakeBody(logMsg *LogMessage) (io.Reader, error) {
var priority int
Expand Down

0 comments on commit 6ae391a

Please sign in to comment.