Send the build version in the outbound User-Agent (closes #313)
check / check (push) Successful in 3m13s
check / check (push) Successful in 3m13s
The http and slack targets sent the fixed User-Agent webhooker/1.0. The delivery engine now takes the version from Globals, the value the web UI footer shows, and one method builds webhooker/<version> for both targets. The http target still sets it after the configured headers, so a configured or inbound User-Agent never reaches the wire. A test builds the engine through its real constructor with a known version and checks the header each target sends. Model: opus-5-5
This commit is contained in:
@@ -1247,11 +1247,6 @@ func TestDoHTTPRequest_ForwardsHeaders(t *testing.T) {
|
||||
testContentType,
|
||||
receivedHeaders.Get("Content-Type"),
|
||||
)
|
||||
|
||||
assert.Equal(t,
|
||||
"webhooker/1.0",
|
||||
receivedHeaders.Get("User-Agent"),
|
||||
)
|
||||
}
|
||||
|
||||
// The event's stored inbound headers carry the same Content-Type the
|
||||
@@ -1320,6 +1315,7 @@ func TestApplyRequestHeaders_SendsOneContentType(t *testing.T) {
|
||||
ContentType: tc.event,
|
||||
},
|
||||
cfg,
|
||||
"webhooker/dev",
|
||||
)
|
||||
|
||||
assert.Equal(t,
|
||||
|
||||
Reference in New Issue
Block a user