Merge branch 'mattn:master' into master

This commit is contained in:
Rasmus Lindroth 2022-03-07 18:12:12 +01:00 committed by GitHub
commit e2f936b91b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -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) [![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) [![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) [![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/:id/lists
* [x] GET /api/v1/accounts/relationships * [x] GET /api/v1/accounts/relationships
* [x] GET /api/v1/accounts/search * [x] GET /api/v1/accounts/search
* [x] GET /api/v1/bookmarks
* [x] POST /api/v1/apps * [x] POST /api/v1/apps
* [x] GET /api/v1/blocks * [x] GET /api/v1/blocks
* [x] GET /api/v1/conversations * [x] GET /api/v1/conversations
@ -131,6 +132,8 @@ func main() {
* [x] POST /api/v1/statuses/:id/unreblog * [x] POST /api/v1/statuses/:id/unreblog
* [x] POST /api/v1/statuses/:id/favourite * [x] POST /api/v1/statuses/:id/favourite
* [x] POST /api/v1/statuses/:id/unfavourite * [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/home
* [x] GET /api/v1/timelines/public * [x] GET /api/v1/timelines/public
* [x] GET /api/v1/timelines/tag/:hashtag * [x] GET /api/v1/timelines/tag/:hashtag

View file

@ -92,7 +92,10 @@ func (c *Client) streaming(ctx context.Context, p string, params url.Values) (ch
return nil, err return nil, err
} }
req = req.WithContext(ctx) 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) q := make(chan Event)
go func() { go func() {