go-twitch/api/transport.go

16 lines
336 B
Go
Raw Normal View History

2024-03-07 19:06:02 -05:00
package api
import "net/http"
type apiTransport struct {
clientId string
}
var _ http.RoundTripper = (*apiTransport)(nil)
// RoundTrip implements http.RoundTripper.
func (a *apiTransport) RoundTrip(req *http.Request) (*http.Response, error) {
req.Header.Add("Client-ID", a.clientId)
return http.DefaultTransport.RoundTrip(req)
}