@ -20,9 +20,11 @@ import (
"fmt"
"fmt"
"io"
"io"
"net/http"
"net/http"
"strings"
"k8s.io/helm/pkg/tlsutil"
"k8s.io/helm/pkg/tlsutil"
"k8s.io/helm/pkg/urlutil"
"k8s.io/helm/pkg/urlutil"
"k8s.io/helm/pkg/version"
)
)
//httpGetter is the efault HTTP(/S) backend handler
//httpGetter is the efault HTTP(/S) backend handler
@ -34,7 +36,15 @@ type httpGetter struct {
func ( g * httpGetter ) Get ( href string ) ( * bytes . Buffer , error ) {
func ( g * httpGetter ) Get ( href string ) ( * bytes . Buffer , error ) {
buf := bytes . NewBuffer ( nil )
buf := bytes . NewBuffer ( nil )
resp , err := g . client . Get ( href )
// Set a helm specific user agent so that a repo server and metrics can
// separate helm calls from other tools interacting with repos.
req , err := http . NewRequest ( "GET" , href , nil )
if err != nil {
return buf , err
}
req . Header . Set ( "User-Agent" , "Helm/" + strings . TrimPrefix ( version . GetVersion ( ) , "v" ) )
resp , err := g . client . Do ( req )
if err != nil {
if err != nil {
return buf , err
return buf , err
}
}