Commit 9cd9c979 authored by Cristian Maglie's avatar Cristian Maglie

Fixed TestUserAgentHeader and TestProxy

parent 087a6f56
......@@ -134,5 +134,7 @@ issues:
- path-except: internal/cli/
linters:
- forbidigo
- path: internal/cli/.*_test.go
linters: [forbidigo]
- path: internal/cli/feedback/
linters: [forbidigo]
......@@ -64,6 +64,10 @@ func SetDefaults(settings *Settings) {
// updater settings
setDefaultValueAndKeyTypeSchema("updater.enable_notification", true)
// network settings
setKeyTypeSchema("network.proxy", "")
setKeyTypeSchema("network.user_agent_ext", "")
}
// InjectEnvVars change settings based on the environment variables values
......
......@@ -33,7 +33,7 @@ func TestUserAgentHeader(t *testing.T) {
defer ts.Close()
settings := configuration.NewSettings()
settings.Set("network.user_agent_ext", "test-user-agent")
require.NoError(t, settings.Set("network.user_agent_ext", "test-user-agent"))
client, err := settings.NewHttpClient()
require.NoError(t, err)
......@@ -46,6 +46,7 @@ func TestUserAgentHeader(t *testing.T) {
b, err := io.ReadAll(response.Body)
require.NoError(t, err)
fmt.Println("RESPONSE:", string(b))
require.Contains(t, string(b), "test-user-agent")
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment