func (u *defaultUpgrader) upgrade(req *client.Request, config *client.Config) (httpstream.Connection, error) {
	return req.Upgrade(config, spdy.NewRoundTripper)
}
Пример #2
0
func overrideAuth(token string, req *client.Request) *client.Request {
	if len(token) > 0 {
		req.SetHeader("Authorization", fmt.Sprintf("Bearer %s", token))
	}
	return req
}