mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
Merge pull request #3720 from DarthSett/master
Adding the "user-agent" Header
This commit is contained in:
@@ -29,7 +29,11 @@ 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"); "Scope_Probe/"+expectedVersion!=have {
|
||||
t.Errorf("want %q, have %q","Scope_Probe/"+expectedVersion,have)
|
||||
}
|
||||
|
||||
var have report.Report
|
||||
|
||||
@@ -46,6 +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_Probe/"+pc.ProbeVersion )
|
||||
|
||||
|
||||
}
|
||||
|
||||
func (pc ProbeConfig) authorizedRequest(method string, urlStr string, body io.Reader) (*http.Request, error) {
|
||||
|
||||
Reference in New Issue
Block a user