aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2022-03-30 16:29:47 -0500
committerAnthony Wang2022-03-30 16:29:47 -0500
commitfdae736f2217df294f190f272bc0cd6eeb3c405b (patch)
treecd7d1abcb57d0a62e9b23f3ecace032714183495
parent1da0d49de771aa7be917a76fe01d66e79283c5a0 (diff)
Remove unneeded copy
-rw-r--r--modules/activitypub/client.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/activitypub/client.go b/modules/activitypub/client.go
index 072090912..9cd9f0dc3 100644
--- a/modules/activitypub/client.go
+++ b/modules/activitypub/client.go
@@ -100,9 +100,7 @@ func NewClient(user *user_model.User, pubID string) (c *Client, err error) {
// NewRequest function
func (c *Client) NewRequest(b []byte, to string) (req *http.Request, err error) {
- byteCopy := make([]byte, len(b))
- copy(byteCopy, b)
- buf := bytes.NewBuffer(byteCopy)
+ buf := bytes.NewBuffer(b)
req, err = http.NewRequest(http.MethodPost, to, buf)
if err != nil {
return