mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-15 19:41:02 +00:00
Add user-agent header
This commit is contained in:
@@ -3,7 +3,6 @@ package appclient
|
||||
import (
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"github.com/weaveworks/scope/app"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
@@ -30,12 +29,9 @@ func dummyServer(t *testing.T, expectedToken, expectedID string, expectedVersion
|
||||
}
|
||||
|
||||
if have := r.Header.Get(xfer.ScopeProbeVersionHeader); expectedVersion != have {
|
||||
t.Errorf("want %q, have %q", expectedID, have)
|
||||
t.Errorf("want %q, have %q", expectedVersion, have)
|
||||
}
|
||||
|
||||
if have := r.Header.Get("user-agent"); have != "Scope/1.11.6" {
|
||||
t.Errorf("want %q, have %q", app.Version, have)
|
||||
}
|
||||
var have report.Report
|
||||
|
||||
reader := r.Body
|
||||
|
||||
@@ -46,7 +46,9 @@ func (pc ProbeConfig) authorizeHeaders(headers http.Header) {
|
||||
}
|
||||
headers.Set(xfer.ScopeProbeIDHeader, pc.ProbeID)
|
||||
headers.Set(xfer.ScopeProbeVersionHeader, pc.ProbeVersion)
|
||||
headers.Set("user-agent","Scope/1.11.6" )
|
||||
headers.Set("user-agent","Probe_Scope/"+pc.ProbeVersion )
|
||||
|
||||
|
||||
}
|
||||
|
||||
func (pc ProbeConfig) authorizedRequest(method string, urlStr string, body io.Reader) (*http.Request, error) {
|
||||
|
||||
Reference in New Issue
Block a user