From 56d11bbff479c525b4c594734d2f041c9320ffdd Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 28 Nov 2023 10:55:18 +0100 Subject: [PATCH] Don't hardcode method in NewRequest function --- modules/activitypub/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/activitypub/client.go b/modules/activitypub/client.go index e07ae614fa..dc42e14cdf 100644 --- a/modules/activitypub/client.go +++ b/modules/activitypub/client.go @@ -97,9 +97,9 @@ func NewClient(ctx context.Context, user *user_model.User, pubID string) (c *Cli } // NewRequest function -func (c *Client) NewRequest(b []byte, to string) (req *http.Request, err error) { +func (c *Client) NewRequest(method string, b []byte, to string) (req *http.Request, err error) { buf := bytes.NewBuffer(b) - req, err = http.NewRequest(http.MethodPost, to, buf) + req, err = http.NewRequest(method, to, buf) if err != nil { return nil, err }