refactor(http): implement bufio (#1604)

* fix: misc http fixes

* feat(io): implement bufio around syscalls

* peek-a-boo

* this can't be right.

* you better be wearing a helmet

* jesus christ.

* refactor(notifications): check err on non-ok status

* fix(notifications): add missing name method

* refactor(indexer): api clients

* fix(indexer): ptp test

---------

Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
Kyle Sanderson 2024-08-28 23:51:20 -07:00 committed by GitHub
parent d13b421c42
commit cc0cca9f0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 465 additions and 304 deletions

View file

@ -4,6 +4,7 @@
package whisparr
import (
"bufio"
"context"
"encoding/json"
"io"
@ -92,7 +93,7 @@ func (c *client) Test(ctx context.Context) (*SystemStatusResponse, error) {
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
body, err := io.ReadAll(bufio.NewReader(res.Body))
if err != nil {
return nil, errors.Wrap(err, "could not read body")
}
@ -120,7 +121,7 @@ func (c *client) Push(ctx context.Context, release Release) ([]string, error) {
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
body, err := io.ReadAll(bufio.NewReader(res.Body))
if err != nil {
return nil, errors.Wrap(err, "could not read body")
}