X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/fb4231f67ad16724f24df55cc9a3d0e4aa8fb7f3..ef23c3d124b24a461f6947868a28e67e7a0a1010:/sdk/go/arvados/client.go diff --git a/sdk/go/arvados/client.go b/sdk/go/arvados/client.go index 102018bb12..a5815987b1 100644 --- a/sdk/go/arvados/client.go +++ b/sdk/go/arvados/client.go @@ -121,16 +121,16 @@ var reqIDGen = httpserver.IDGenerator{Prefix: "req-"} // Do adds Authorization and X-Request-Id headers and then calls // (*http.Client)Do(). func (c *Client) Do(req *http.Request) (*http.Response, error) { - if auth, _ := req.Context().Value("Authorization").(string); auth != "" { + if auth, _ := req.Context().Value(contextKeyAuthorization{}).(string); auth != "" { req.Header.Add("Authorization", auth) } else if c.AuthToken != "" { req.Header.Add("Authorization", "OAuth2 "+c.AuthToken) } if req.Header.Get("X-Request-Id") == "" { - reqid, _ := req.Context().Value(contextKeyRequestID).(string) + reqid, _ := req.Context().Value(contextKeyRequestID{}).(string) if reqid == "" { - reqid, _ = c.context().Value(contextKeyRequestID).(string) + reqid, _ = c.context().Value(contextKeyRequestID{}).(string) } if reqid == "" { reqid = reqIDGen.Next()