diff --git a/README.md b/README.md index dbda926..a60f93f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://github.com/mattn/go-mastodon/workflows/test/badge.svg?branch=master)](https://github.com/mattn/go-mastodon/actions?query=workflow%3Atest) [![Codecov](https://codecov.io/gh/mattn/go-mastodon/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-mastodon) -[![GoDoc](https://godoc.org/github.com/mattn/go-mastodon?status.svg)](http://godoc.org/github.com/mattn/go-mastodon) +[![Go Reference](https://pkg.go.dev/badge/github.com/mattn/go-mastodon.svg)](https://pkg.go.dev/github.com/mattn/go-mastodon) [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-mastodon)](https://goreportcard.com/report/github.com/mattn/go-mastodon) @@ -86,6 +86,7 @@ func main() { * [x] GET /api/v1/accounts/:id/lists * [x] GET /api/v1/accounts/relationships * [x] GET /api/v1/accounts/search +* [x] GET /api/v1/bookmarks * [x] POST /api/v1/apps * [x] GET /api/v1/blocks * [x] GET /api/v1/conversations @@ -131,6 +132,8 @@ func main() { * [x] POST /api/v1/statuses/:id/unreblog * [x] POST /api/v1/statuses/:id/favourite * [x] POST /api/v1/statuses/:id/unfavourite +* [x] POST /api/v1/statuses/:id/bookmark +* [x] POST /api/v1/statuses/:id/unbookmark * [x] GET /api/v1/timelines/home * [x] GET /api/v1/timelines/public * [x] GET /api/v1/timelines/tag/:hashtag diff --git a/streaming.go b/streaming.go index f560fd8..2148ed0 100644 --- a/streaming.go +++ b/streaming.go @@ -92,7 +92,10 @@ func (c *Client) streaming(ctx context.Context, p string, params url.Values) (ch return nil, err } req = req.WithContext(ctx) - req.Header.Set("Authorization", "Bearer "+c.Config.AccessToken) + + if c.Config.AccessToken != "" { + req.Header.Set("Authorization", "Bearer "+c.Config.AccessToken) + } q := make(chan Event) go func() {