Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(87)

Unified Diff: storage/storage.go

Issue 150090043: cloud: Adding a user-agent to the outgoing request
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« internal/cloud.go ('K') | « internal/cloud.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/storage.go
diff --git a/storage/storage.go b/storage/storage.go
index 3cea67bedac0f92c9ee2e994f00a0af253cfbc30..faeef9f3455c8963c6d17549472c6026cc7402ea 100644
--- a/storage/storage.go
+++ b/storage/storage.go
@@ -22,6 +22,7 @@ import (
"net/http"
raw "code.google.com/p/google-api-go-client/storage/v1"
+ "google.golang.org/cloud/internal"
)
const (
@@ -81,7 +82,10 @@ func New(tr http.RoundTripper) *Client {
// uses the provided http.Client. Provided http.Client is responsible
// to authorize and authenticate the requests made to the
// Google Cloud Storage API.
+// It mutates the client's original Transport to append the cloud
+// package's user-agent to the outgoing requests.
func NewWithClient(c *http.Client) *Client {
+ c.Transport = &internal.UATransport{Base: c.Transport}
s, _ := raw.New(c)
return &Client{conn: &conn{s: s, c: c}}
}
« internal/cloud.go ('K') | « internal/cloud.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b